--- s10k/XmlTools/xmlcustomcode.h 2017/10/05 17:48:32 1073 +++ s10k/XmlTools/xmlcustomcode.h 2019/09/08 13:21:41 1112 @@ -26,14 +26,14 @@ private: const int numThreads; QThreadPool myThreadPool; - QMutex mutexIsAvailable; struct jsCustomCodeEngine{ + /* No need to delete these... They will stay alive until program quits. */ QScriptEngine* scriptEngine; QScriptValue* jsFunction; QScriptValue* getXmlDataFunction; QScriptValue* setXmlDataFunction; - bool isAvailable; + QMutex *mutexForEngine; }; QVector jsScriptEngines; @@ -43,11 +43,10 @@ private: XmlCustomCode& operator=(XmlCustomCode const&); // assignment operator is private void displayJsException(QScriptEngine &engine, QScriptValue &engineResult); - jsCustomCodeEngine& getAvailableJsEngine(); __attribute__((always_inline)) inline void customCodeUnwinding(const QString &fileName, QString &currXmlFileString, - QScriptEngine &engine, clock_t &begin, double elapsed_secs, QScriptValue &engineResult, QScriptValue &jsFunction, - QScriptValue &getXmlDataFunction, QScriptValue &setXmlDataFunction, const bool &backupsEnabled, const bool &verboseEnabled){ + QScriptEngine &engine, clock_t &begin, double elapsed_secs, QScriptValue &engineResult, QScriptValue &jsFunction, + QScriptValue &getXmlDataFunction, QScriptValue &setXmlDataFunction, const bool &backupsEnabled, const bool &verboseEnabled){ if(backupsEnabled){ UtilXmlTools::backupFile(fileName, verboseEnabled); }