History

Fixed script signal proxy crashes

ksuprynowicz committed 2 years ago

Commit 4e819081 parent 8661e8a2 files · +89 −30Browse files

Showing the changes to libraries/script-engine/src/v8/ScriptObjectV8Proxy.h (1 of 2 files). Show all

Unified · Split

libraries/script-engine/src/v8/ScriptObjectV8Proxy.h+8−1
@@ -133,6 +133,7 @@ private: // storage · 132 unmodified lines
133133 QPointer<QObject> _object;
134134 // Handle for its own object
135135 v8::Persistent<v8::Object> _v8Object;
136+ bool _wasDestroyed{false};
136137
137138 Q_DISABLE_COPY(ScriptObjectV8Proxy)
138139 };
@@ -271,7 +272,10 @@ public: // API · 132 unmodified lines
271272 QString fullName() const;
272273
273274 // 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();
275279
276280 private: // storage
277281
@@ -283,6 +287,9 @@ private: // storage · 5 unmodified lines
283287 const int _metaCallId;
284288 ConnectionList _connections;
285289 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 };
286293 // Context in which it was created
287294 v8::UniquePersistent<v8::Context> _v8Context;
288295 // Call counter for debugging purposes. It can be used to determine which signals are overwhelming script engine.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t