Skip to content

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Sep 24, 2025

Fixes #6400.

…l tool window after quitting GRASS

All these wxGUI tool initialize tgis framework (messenger and
C-interface subprocesses) which require to be properly stopped
before quitting GRASS (sending SIGTERM signal), because it causes
"freeze" wxGUI tool window and wxGUI processes are not terminated.
@tmszi tmszi added this to the 8.5.0 milestone Sep 24, 2025
@tmszi tmszi self-assigned this Sep 24, 2025
@tmszi tmszi added bug Something isn't working GUI wxGUI related temporal Related to temporal data processing Python Related code is in Python backport to 8.4 PR needs to be backported to release branch 8.4 labels Sep 24, 2025
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.

It should at least test that the temporal module has been previously imported.

But the Timeline Tool is using OnClose method where it's already calling it, so I think we should investigate why it's not called from there.

@tmszi
Copy link
Member Author

tmszi commented Sep 24, 2025

But the Timeline Tool is using OnClose method where it's already calling it, so I think we should investigate why it's not called from there.

Because wx.EVT_CLOSE event, OnClose() event handler is not triggered by SIGTERM signal.

@petrasovaa
Copy link
Contributor

But the Timeline Tool is using OnClose method where it's already calling it, so I think we should investigate why it's not called from there.

Because wx.EVT_CLOSE event, OnClose() event handler is not triggered by SIGTERM signal.

Right, perhaps the tool should have the main Frame as a parent, that could help, no? Or is there a reason not to?

@tmszi
Copy link
Member Author

tmszi commented Sep 25, 2025

Because wx.EVT_CLOSE event, OnClose() event handler is not triggered by SIGTERM signal.

Right, perhaps the tool should have the main Frame as a parent, that could help, no? Or is there a reason not to?

Yes you are right. If wxGUI tool frame class is initialized with param parent=self, and self.Destroy() method is called from the main window frame (line 2411)

self.Destroy()
wx.EVT_WINDOW_DESTROY event is triggered and we can catch it on the wxGUI tool frame class level. According my debug information problem is that self._quitGRASS() method from the main window frame class (which call SIGTERM signal) is triggered first than wx.EVT_WINDOW_DESTROY event handler on the wxGUI tool frame class level (with code which potential stopping tgis framework messenger and C-interface). We need to wait if tgis framework is stopped and then call the SIGTERM signal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport to 8.4 PR needs to be backported to release branch 8.4 bug Something isn't working GUI wxGUI related Python Related code is in Python temporal Related to temporal data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] The wxGUI animation, timeline, tplot window don't terminated correctly after exiting GRASS GIS

2 participants