1. Martín Lucas Golini
  2. efsw
  3. Issues

Issues

Issue #9 resolved

FileWatherWin32 destructor issue

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 : https://bitbucket.org/sepul/efsw/commits/ca34370fd2806afa1fdb8a1f134fee912a5d7992#chg-src/efsw/FileWatcherWin32.cpp

(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: https://bitbucket.org/sepul/efsw/commits/ca34370fd2806afa1fdb8a1f134fee912a5d7992#chg-include/efsw/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