From efbc8e0066f82ee530b4770e4484d6372e5e7cc1 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Thu, 16 Oct 2014 17:05:13 +0200 Subject: Never manually connect to the destroyed signal of any object. The web channel always connects to that signal automatically for internal book-keeping purposes. Thus we do not have to connect to the signal for wrapped objects. This simplifies the tests and reduces the IPC traffic for wrapped objects. Change-Id: Iaf8d9ce0b87874917cdcdf9013e21a53ee36b53a Reviewed-by: Simon Hausmann --- src/webchannel/qwebchannel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/webchannel/qwebchannel.js b/src/webchannel/qwebchannel.js index 3feb829..d2c6525 100644 --- a/src/webchannel/qwebchannel.js +++ b/src/webchannel/qwebchannel.js @@ -236,8 +236,9 @@ function QObject(name, data, webChannel) object.__objectSignals__[signalIndex] = object.__objectSignals__[signalIndex] || []; object.__objectSignals__[signalIndex].push(callback); - if (!isPropertyNotifySignal) { + if (!isPropertyNotifySignal && signalName !== "destroyed") { // only required for "pure" signals, handled separately for properties in propertyUpdate + // also note that we always get notified about the destroyed signal webChannel.exec({ type: QWebChannelMessageTypes.connectToSignal, object: object.__id__, -- cgit v1.2.1