gui/applets: properly destroy container widget when process is terminated

This commit is contained in:
Sebastien Bourdeauducq 2016-02-11 16:02:10 +01:00
parent c9a9d19182
commit cd9467a8df

View File

@ -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()