FileWatherWin32 destructor issue

Issue #9 resolved
Sepehr Taghdisian
created an issue

Hi Martin The destructor (FileWatcherWin32) attempts to operate on a mThread pointer, were it can be NULL sometimes (like when you don't watch anything before you exit), so it will generate access violation.

I have fixed it in my fork of efsw, though you may want to check it out :

(Also in the fork, I have added vs2012 project files, you may like to add them to your own project, but notice that they use EFSW_NO_WIDECHAR flag , cuz I don't use wide chars)

Comments (3)

  1. Martín Lucas Golini repo owner

    You're right! Thanks for reporting it. The mThread->wait(); wasn't even needed, the Thread destructor calls always to wait. So efSAFE_DELETE( mThread ); is enough.

    I'm curious about the changes in efsw.h: Did you have any problem? Because this was a merge from a contributor.

    Regarding the vs2012 project file it's not necessary, since premake4 can generate the vs2012 project ( i'm using the vs project generate by premake, so it's working fine ). You just need to use the premake4 from the dev branch.

  2. Sepehr Taghdisian reporter

    No, I haven't done any changes to efsw.h , just a very minor style change, I put EFSW_API at the beginning of the function declarations.

    thanks, and keep up the good work

  3. Log in to comment