Skip to content

crash calling a deallocated delegate, plus memory leak #19

@gobbledegook

Description

@gobbledegook

As you are probably aware, once the watcher thread has been started, there is no way to dealloc the VDKQueue object. This is because detachThread retains the target (which is "self"), so the retainCount is 2. Unless you provide a way to stop the thread, the object can never be released! Even worse, if the object was created by its delegate, and the delegate goes away, it will try to send messages to the delegate, causing a crash.

The fix I'm using is to add a new method (stopWatching:) which sets _keepWatcherThreadRunning to NO and removes all the watched path entries, then require the client to call it before calling release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions