Skip to content

Commit

Permalink
fix crash on exit with mouse module
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Jun 8, 2024
1 parent 1af36cc commit 8c782b0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Module/modules/controller/mouse/MouseModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ MouseModule::~MouseModule()

void MouseModule::clearItem()
{
Module::clearItem();
#if JUCE_WINDOWS
MouseHooker::getInstance()->removeListener(this);
if(MouseHooker::getInstanceWithoutCreating() != nullptr) MouseHooker::getInstance()->removeListener(this);
#else
Desktop::getInstance().removeGlobalMouseListener(this);
if(Desktop::getInstanceWithoutCreating() != nullptr) Desktop::getInstance().removeGlobalMouseListener(this);
#endif

Module::clearItem();
}

void MouseModule::setCursorPosition(Point<float>& pos, bool isRelative)
Expand Down

0 comments on commit 8c782b0

Please sign in to comment.