screen_saver filter: Fix use-after-free on destruction.
Stop watching nodes before quitting and therefore deleting the looper that was subscribed.
This commit is contained in:
@@ -120,6 +120,9 @@ ScreenSaverFilter::~ScreenSaverFilter()
|
||||
{
|
||||
be_roster->StopWatching(fController);
|
||||
|
||||
if (fWatchingFile || fWatchingDirectory)
|
||||
watch_node(&fNodeRef, B_STOP_WATCHING, fController);
|
||||
|
||||
// We must quit our controller without being locked, or else we might
|
||||
// deadlock; when the controller is gone, there is no reason to lock
|
||||
// anymore, anyway.
|
||||
@@ -128,9 +131,6 @@ ScreenSaverFilter::~ScreenSaverFilter()
|
||||
|
||||
delete fCornerRunner;
|
||||
delete fRunner;
|
||||
|
||||
if (fWatchingFile || fWatchingDirectory)
|
||||
watch_node(&fNodeRef, B_STOP_WATCHING, fController);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user