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

wxGUI/rlisetup: dissociate the managed window from the manager ('wx.aui.AuiManager' instance) before destroy wizard window #1196

Merged
merged 1 commit into from
Jan 7, 2021

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Dec 20, 2020

To Reproduce:

Steps to reproduce the behavior:

  1. Launch 'Set up sampling and analysis framework' g.gui.rlisetup
  2. Hit Create button on 'Setup for r.li modules' wxGUI dialog
  3. On the first page 'Select maps and define name' of 'Create new configuration file for r.li modules' wizard fill out the form as follows
    g_gui_rlisetup_first_wizard_page
  4. Hit Next button
  5. On the next wizard page 'Draw sampling frame', draw rectangle (holding down left mouse click and moving down or up) and hit Next button
  6. On the next wizard page 'Insert sampling areas' hit Cancel button
  7. You get error message

Error message:

wx._core
.
wxAssertionError
:
C++ assertion "GetEventHandler() == this" failed at /var/tmp
/portage/x11-libs/wxGTK-3.0.4-r302/work/wxWidgets-3.0.4/src/
common/wincmn.cpp(477) in ~wxWindowBase(): any pushed event
handlers must have been removed
The above exception was the direct cause of the following
exception:
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-
packages/wx/lib/agw/customtreectrl.py", line 8183, in
OnInternalIdle

if not self.HasAGWFlag(TR_MULTIPLE) and not
self.GetSelection():
  File "/usr/lib64/python3.6/site-
packages/wx/lib/agw/customtreectrl.py", line 3534, in
HasAGWFlag

return bool(self._agwStyle & flag)
SystemError
:
<class 'bool'> returned a result with an error set

@tmszi tmszi self-assigned this Dec 20, 2020
@tmszi tmszi added bug Something isn't working GUI wxGUI related labels Dec 20, 2020
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this rather obscure error. I am not sure wx.EVT_WINDOW_DESTROY is a good idea here, see e.g. https://discuss.wxpython.org/t/problems-with-wx-evt-window-destroy/23546/3

I would rather explicitly call the UnInit, maybe from the _cleanup function from the rlisetup/wizard.py.

…ui.AuiManager' instance) before destroy wizard window
@tmszi tmszi force-pushed the g_g_gui_rlisetup-fix-uninit-auimanager branch from 22178fe to eb24ecb Compare January 6, 2021 05:25
@tmszi
Copy link
Member Author

tmszi commented Jan 6, 2021

Thanks for fixing this rather obscure error. I am not sure wx.EVT_WINDOW_DESTROY is a good idea here, see e.g. https://discuss.wxpython.org/t/problems-with-wx-evt-window-destroy/23546/3

I would rather explicitly call the UnInit, maybe from the _cleanup function from the rlisetup/wizard.py.

Fixed in the eb24ecb.

@tmszi tmszi requested a review from petrasovaa January 6, 2021 05:28
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you

@tmszi tmszi merged commit 505f156 into OSGeo:master Jan 7, 2021
@tmszi tmszi deleted the g_g_gui_rlisetup-fix-uninit-auimanager branch January 7, 2021 05:28
tmszi added a commit to tmszi/grass that referenced this pull request Jan 7, 2021
…ui.AuiManager' instance) before destroy wizard window (OSGeo#1196)
@neteler neteler added this to the 7.8.6 milestone Jan 23, 2021
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
…ui.AuiManager' instance) before destroy wizard window (OSGeo#1196)
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
…ui.AuiManager' instance) before destroy wizard window (OSGeo#1196)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GUI wxGUI related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants