Keyset Memory Management Bugfix
[pierogi] / macros / pirmacro.cpp
index b1a9475..10753c2 100644 (file)
@@ -200,18 +200,19 @@ bool PIRMacro::executeMacro()
   // Don't start a new macro if one is already running:
   if (macroRunning) return false;
 
+  // Start running the list of commands:
+  macroRunning = true;
+
   currentCommand = commands.begin();
 
   // If this macro is empty, just return:
   if (currentCommand == commands.end())
   {
     emit macroCompleted();
+    macroRunning = false;
     return true;
   }
 
-  // Start running the list of commands:
-  macroRunning = true;
-
   // Take note of the current keyset id:
   preMacroKeysetID = mainWindow->getCurrentKeyset();