diff options
Diffstat (limited to 'src/qobject.js')
-rw-r--r-- | src/qobject.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qobject.js b/src/qobject.js index cbff4f1..048295c 100644 --- a/src/qobject.js +++ b/src/qobject.js @@ -71,6 +71,12 @@ function QObject(name, data, webChannel) qObject.destroyed.connect(function() { if (webChannel.objectMap[objectId] === qObject) { delete webChannel.objectMap[objectId]; + // reset the now deleted QObject to an empty {} object + // just assigning {} though would not have the desired effect, but the + // below also ensures all external references will see the empty map + for (var prop in qObject) { + delete qObject[prop]; + } } }); return qObject; |