From cd9467a8df393a9eb4734b88a28d8662254f24db Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 11 Feb 2016 16:02:10 +0100 Subject: [PATCH] gui/applets: properly destroy container widget when process is terminated --- artiq/gui/applets.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/artiq/gui/applets.py b/artiq/gui/applets.py index a9fc4acf5..82e93b686 100644 --- a/artiq/gui/applets.py +++ b/artiq/gui/applets.py @@ -114,8 +114,8 @@ class AppletDock(dockarea.Dock): def embed(self, win_id): logger.debug("capturing window 0x%x for %s", win_id, self.applet_name) embed_window = QtGui.QWindow.fromWinId(win_id) - embed_widget = QtWidgets.QWidget.createWindowContainer(embed_window) - self.addWidget(embed_widget) + self.embed_widget = QtWidgets.QWidget.createWindowContainer(embed_window) + self.addWidget(self.embed_widget) async def terminate(self): if hasattr(self, "ipc"): @@ -133,6 +133,9 @@ class AppletDock(dockarea.Dock): await self.ipc.process.wait() del self.ipc + self.embed_widget.deleteLater() + del self.embed_widget + async def restart(self): await self.terminate() await self.start()