direct: Resolve DirectScrolledFrame crash on destroy

Destroying DirectScrolledFrames currently crashes the game, because they are destroyed twice. This commit makes sure to destroy the scrolls only once.

Closes #574
This commit is contained in:
Derzsi Dániel 2019-03-04 00:21:23 +02:00 committed by rdb
parent 155b1c38ad
commit c337e58f4d

View File

@ -100,8 +100,10 @@ class DirectScrolledFrame(DirectFrame):
simpleChildGui = self.guiDict.get(parts[-1]) simpleChildGui = self.guiDict.get(parts[-1])
if simpleChildGui: if simpleChildGui:
simpleChildGui.destroy() simpleChildGui.destroy()
self.verticalScroll.destroy() if self.verticalScroll:
self.horizontalScroll.destroy() self.verticalScroll.destroy()
del self.verticalScroll if self.horizontalScroll:
del self.horizontalScroll self.horizontalScroll.destroy()
self.verticalScroll = None
self.horizontalScroll = None
DirectFrame.destroy(self) DirectFrame.destroy(self)