Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatmenu memory usage improvements #2373

Merged
merged 2 commits into from
Jul 8, 2024
Merged

flatmenu memory usage improvements #2373

merged 2 commits into from
Jul 8, 2024

Conversation

arjones6
Copy link
Contributor

Makes FlatMenuItem check mark and radio button bitmaps per class variables instead of per instance variables so that individual bitmaps aren't created for each menu item. Also cleans up child menu items if a parent menu is explicitly destroyed.

Fixes #2372

flatmenu memory usage improvements
@arjones6 arjones6 mentioned this pull request May 2, 2023
@RobinD42
Copy link
Member

RobinD42 commented Jul 7, 2024

This pull request has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/advice-on-approach-to-menu-editor/36994/9

emersonrp added a commit to emersonrp/bindcontrol that referenced this pull request Jul 7, 2024
emersonrp added a commit to emersonrp/bindcontrol that referenced this pull request Jul 7, 2024
@swt2c swt2c merged commit 50ea759 into wxWidgets:master Jul 8, 2024
emersonrp added a commit to emersonrp/bindcontrol that referenced this pull request Jul 8, 2024
@komoto48g
Copy link
Contributor

komoto48g commented Jul 11, 2024

@swt2c, the merged commit has TabError.
@emersonrp, please revert and make a new PR, if you have time.
In addition, Destroy is expected to return a bool and raise a TypeError if it does not.
For example, it is preferable to change it to:

def Destroy(self, *args, **kwargs):
    try:
        self.Clear()
    finally:
        return super().Destroy(*args, **kwargs)

@swt2c
Copy link
Collaborator

swt2c commented Jul 12, 2024

@komoto48g fixed.

emersonrp added a commit to emersonrp/bindcontrol that referenced this pull request Jul 18, 2024
emersonrp added a commit to emersonrp/bindcontrol that referenced this pull request Jul 25, 2024
emersonrp added a commit to emersonrp/bindcontrol that referenced this pull request Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FlatMenu memory leak
4 participants