Commit Graph

17 Commits

Author SHA1 Message Date
Martchus 4387e50202 Join all threads before destructing the renaming engine 2020-11-27 00:40:45 +01:00
Martchus c06d1f5f53 Fix compilation with no JavaScript provider 2020-09-08 19:09:12 +02:00
Martchus 7ed5723fd9 Use Q_SIGNALS instead of signals 2020-03-09 18:46:08 +01:00
Martchus 3e58d67c4c Don't use lower-case Qt macros 2020-03-08 14:04:29 +01:00
Martchus 865e461032 Avoid using QAtomicInteger functions deprecated in Qt 5.14.0 2019-12-15 19:31:34 +01:00
Martchus 72e918b154 Remove debugging leftover 2019-10-11 19:55:45 +02:00
Martchus 4531d10a81 Move QJSEngine into the thread which executes the JavaScript
This fixes https://github.com/Martchus/tageditor/issues/50.

When keeping the QJSEngine tied to the main thread the garbage
collector will run on the main thread's event loop. This leads to
crashes when trying to allocate memory within the engine from
another thread (`QV4::PersistentValueStorage::allocate()`).

The Qt documentation does not mention that the garbage collector
might run on the event loop of the thread tied to the JSEngine.
I expected it only to run after or before allocations/deletions
within the thread calling the engine's methods. There is already
an issue regarding the lack of documentation:
https://bugreports.qt.io/browse/QTBUG-57227

I found no way to obtain the QThread object for a thread started
with Qt Concurrent. The possibility I found was calling
`QThread::currentThread()` from the concurrent thread once it has
already been started. However, when the concurrent thread has
been started it might already be too late to move the engine.
Adding further synchronization to solve this is an overkill so
I resorted to using QThread directly.
2019-10-11 19:47:30 +02:00
Martchus 4b7d7a9499 Apply clang-format 2018-03-07 01:18:01 +01:00
Martchus b34a0e635f Use JS provider defs provided by qtutilities 2017-03-21 10:01:18 +01:00
Martchus 0531460df9 renaming utility: Get rid of useless mutex 2017-01-06 22:00:27 +01:00
Martchus 537d31289d Fix typo 2017-01-06 21:29:43 +01:00
Martchus ec43ad8499 make web view and JavaScript engine optional 2016-04-21 23:56:10 +02:00
Martchus eaea2e2cda use Qt Concurrent instead of pthread 2016-03-10 22:13:43 +01:00
Martchus 1c4d577264 updated renaming utility
- allow usage of QJSEngine instead of deprecated QScriptEngine
- moved variables and functions from global object to tageditor object
2016-01-09 02:56:56 +01:00
Martchus 29795cc016 added missing include 2015-10-16 22:07:04 +02:00
Martchus dfe17afcc6 use only one engine, small adjustments 2015-10-13 20:12:00 +02:00
Martchus b2b8231a27 First commit 2015-04-22 19:33:53 +02:00