nsmela / brachify

test app for a brachy applicator builder
GNU General Public License v3.0
0 stars 0 forks source link

Avoiding memory leaks #33

Closed nsmela closed 11 months ago

nsmela commented 1 year ago

https://stackoverflow.com/questions/37918012/pyqt-when-are-widgets-with-parents-deleted/37928086#37928086

Long story short: need to ensure objects are created in python in Qt or the c++ object might not be caught when exiting.

michaelwkudla commented 11 months ago

Seems important for the case where someone leaves the program open and imports a bunch of different plans, but probably not necessary for a beta.

nsmela commented 11 months ago

It may also affect users even when the app is closed.

Dialogs are a main concern. This is how they should be handled:

This can be used to check for issues:

print('\n'.join(repr(w) for w in app.allWidgets()))

dialogs are a concern and should be handled like this:

def openDialog(self):
    self.dialog = MyDialog()
    self.dialog.show()
nsmela commented 11 months ago

we won't have to sorry about this from what I'm seeing.