Answers

I may be reading the braces wrong, but it looks like you're checking m_file outside of the CreateFileAsync's then clause. This is a race condition: there is no guarantee which will run first, and I'd actually expect the then clause to run after more often
than not.

You should move the code which depends on the completion into the then handler.

All replies

I may be reading the braces wrong, but it looks like you're checking m_file outside of the CreateFileAsync's then clause. This is a race condition: there is no guarantee which will run first, and I'd actually expect the then clause to run after more often
than not.

You should move the code which depends on the completion into the then handler.