Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Synchronize deletion of mInterface in NSFW destructor #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/NSFW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ NSFW::NSFW(uint32_t debounceMS, std::string path, Callback *eventCallback, Callb
}

NSFW::~NSFW() {
if (mInterface != NULL) {
delete mInterface;
}
delete mEventCallback;
delete mErrorCallback;

if (mInterfaceLockValid) {
uv_mutex_lock(&mInterfaceLock);
if (mInterface != NULL) {
delete mInterface;
}
uv_mutex_unlock(&mInterfaceLock);
uv_mutex_destroy(&mInterfaceLock);
}
}
Expand Down