ofstream access violations when multi-threading
I keep getting access violations occurring in the constructor and destructor of an ofstream variable, usually at a line involving dynamic memory allocation/deallocation. I think its something to do with my app using multiple threads, since I dont really know when/how exactly I need to protect code/data from synchronization problems.
I know its really vague but does anyone have any ideas on the most likely cause of this problem?
thanks
Cameron
Not all of the run-time libraries are thread-safe.
Are you using MSVC? Make sure you''re linking to the Mutlithreaded version of the dll/lib.
You can also try using _beginthreadex instead of CreateThread to make your threads.
Are you using MSVC? Make sure you''re linking to the Mutlithreaded version of the dll/lib.
You can also try using _beginthreadex instead of CreateThread to make your threads.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement