-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put clipboard data on the system stack (#617)
The clipboard data structures are created by the first document on the heap and then are subsequently overridden by other documents. It can be a better design to put the clipboard data into one central place on the stack of `System` as it is available during the lifetime of the program.
- Loading branch information
Showing
3 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c438af6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ever since this commit (Release 8482864821), TreeSheets crashes upon exit and writes a crash dump in
%HOMEPATH%\AppData\Local\CrashDumps
. The issue does not happen with Release 8473991279.My computer is running Windows 10 x64.
c438af6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c438af6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @t2b3 ,
Thanks for the feedback!
I should have been more clear: I tested ALL releases since this commit, including Release 8566882814 from earlier today, and the issue happens with all of them. I suppose it has to do with the changes in the code that handles clipboard data.
c438af6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c438af6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it always crashes, even if I just open and the close the application.
One thing I noticed: it happens while closing a file. I have 4 files that I always keep open. In my last test, instead of quitting with CTRL+Q, I tried closing each file with CTRL+W, and TreeSheets crashed on one of the them (I did this a few times and it happened on different files). When I ran TreeSheets again, the file that I had tried to close when the crash happened was reloaded, as if I hadn't explicitly closed it.
c438af6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for discovering the issue!
I could reproduce the issue and indeed now pushed a fix (hopefully for it).
The problem is that
https://docs.wxwidgets.org/latest/classwx_drop_target.html#ac7af5b2047050278248dc9ab41625892
the destructor of wxDropTarget frees the data per page destruction, and if we have multiple pages closing, it tries to free the data structure multiple times leading to the crash.
c438af6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested Release 8575186124 and the issue is fixed. Great work! Thanks a lot!
c438af6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are welcome! :-) And thanks to you for discovering the issue! 👍