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

Fix crash when window is closed while thread running #685

Merged
merged 5 commits into from Oct 30, 2020
Merged

Fix crash when window is closed while thread running #685

merged 5 commits into from Oct 30, 2020

Conversation

samuel-w
Copy link
Contributor

@samuel-w samuel-w commented Oct 10, 2020

Fixes #684

I only opened the issue to confirm that it wasn't a weird setup issue, since I remember this not crashing in the past.

Opening and closing the window is so much faster now, as an upside.

Check to make sure this doesn't reintroduce #340, doesn't in my testing.

@samuel-w
Copy link
Contributor Author

samuel-w commented Oct 10, 2020

Takes up about 6-10MB more memory when window closed.

@m3nu
Copy link
Contributor

m3nu commented Oct 10, 2020

Sounds good. You want to do a PR for those changes, since you already have them working? I'll test on macOS.

@samuel-w
Copy link
Contributor Author

This is the pull request.
Here is what I have tested, all working:

  • Closing/opening window with repository window open
  • Running check and opening/closing window
  • Creating backup from tray and opening/closing
  • Creating backup from window and opening/closing

@samuel-w
Copy link
Contributor Author

samuel-w commented Oct 10, 2020

Another solution is making the parent of the threads VortaApp.

Downsides:
The main window will be slower to open.
Upsides:
Cleaner solution
Doesn't undo an earlier commit
Saves tiny amount of memory
Easier to test

@samuel-w
Copy link
Contributor Author

samuel-w commented Oct 10, 2020

Went with the alternate method of fixing it, see comment above. Might undo it later, since I'm still on the fence about it.

Closing and opening the window clears the messages. Going to fix that. Would be easier to keep the messages using original method.

@samuel-w samuel-w marked this pull request as draft October 10, 2020 07:30
@m3nu
Copy link
Contributor

m3nu commented Oct 10, 2020

Closing and opening the window clears the messages. Going to fix that. Would be easier to keep the messages using original method.

I also think that keeping the window state would have benefits.

@samuel-w samuel-w changed the title Fix crash that occurs whenever the main window is closed while a thread is running Fix crash when window is closed while thread running Oct 12, 2020
@m3nu
Copy link
Contributor

m3nu commented Oct 12, 2020

Tested on macOS. Didn't see any issues. Actually nice to keep the window state when reopening it.

@samuel-w
Copy link
Contributor Author

I've decided to both keep the window state, and correctly set the borg thread parents. Technically the second one is not needed, but its nice to have.

@samuel-w samuel-w marked this pull request as ready for review October 13, 2020 06:49
@m3nu m3nu merged commit cc47c1b into borgbase:master Oct 30, 2020
@m3nu
Copy link
Contributor

m3nu commented Oct 30, 2020

Merged. I like it how window state, logs, etc are preserved. Good change!

@samuel-w samuel-w deleted the undo_crash branch October 30, 2020 06:14
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.

Crash occurs whenever the main window is closed while an archive action is running
2 participants