Showing the changes to libraries/script-engine/src/v8/ScriptObjectV8Proxy.h (1 of 2 files). Show all
Unified · Split
| @@ -133,6 +133,7 @@ private: // storage · 132 unmodified lines | ||
| 133 | 133 | QPointer<QObject> _object; |
| 134 | 134 | // Handle for its own object |
| 135 | 135 | v8::Persistent<v8::Object> _v8Object; |
| 136 | + bool _wasDestroyed{false}; | |
| 136 | 137 | |
| 137 | 138 | Q_DISABLE_COPY(ScriptObjectV8Proxy) |
| 138 | 139 | }; |
| @@ -271,7 +272,10 @@ public: // API · 132 unmodified lines | ||
| 271 | 272 | QString fullName() const; |
| 272 | 273 | |
| 273 | 274 | // Disconnects all signals from the proxy |
| 274 | − void disconnectAll() { QObject::disconnect(this, nullptr, nullptr, nullptr); }; | |
| 275 | + void disconnectAll(); | |
| 276 | + | |
| 277 | + // This should be called only just before destruction of ScriptSignalV8Proxy | |
| 278 | + void disconnectAllScriptSignalProxies(); | |
| 275 | 279 | |
| 276 | 280 | private: // storage |
| 277 | 281 | |
| @@ -283,6 +287,9 @@ private: // storage · 5 unmodified lines | ||
| 283 | 287 | const int _metaCallId; |
| 284 | 288 | ConnectionList _connections; |
| 285 | 289 | bool _isConnected{ false }; |
| 290 | + | |
| 291 | + // This allows skipping qobject check during disconnect, which is needed during cleanup because qobject is already deleted | |
| 292 | + bool _cleanup{ false }; | |
| 286 | 293 | // Context in which it was created |
| 287 | 294 | v8::UniquePersistent<v8::Context> _v8Context; |
| 288 | 295 | // Call counter for debugging purposes. It can be used to determine which signals are overwhelming script engine. |