diff --git a/scenesw/scenesw.cpp b/scenesw/scenesw.cpp index 52356e8e..aa469c50 100644 --- a/scenesw/scenesw.cpp +++ b/scenesw/scenesw.cpp @@ -58,12 +58,12 @@ bool LoadPlugin() void UnloadPlugin() { - if (thePlugin->GetSettings()->hotkeyID) - OBSDeleteHotkey(thePlugin->GetSettings()->hotkeyID); - if(thePlugin) { - delete thePlugin; + if (thePlugin->GetSettings()->hotkeyID) + OBSDeleteHotkey(thePlugin->GetSettings()->hotkeyID); + + delete thePlugin; thePlugin = NULL; } }