forked from M-Labs/artiq
gui/applets: properly destroy container widget when process is terminated
This commit is contained in:
parent
c9a9d19182
commit
cd9467a8df
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user