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 macos crash #1746

Merged
merged 4 commits into from
Jul 22, 2024
Merged

Fix macos crash #1746

merged 4 commits into from
Jul 22, 2024

Conversation

MinyazevR
Copy link
Member

@MinyazevR MinyazevR commented Jul 18, 2024

Fixed #1707
Problem description: dragging an element using QDrag->exec() crashed the program, because by the time DraggableElement was called, it automatically managed to free itself.
Even though the palette has been updated with Qt::QueuedConnection, which made it possible to call mousePressEvent
using drag->exec() before cleaning the elements, the drag->exec() call is not blocked in macOS. As a solution, it was possible to block the event loop for drag->exec(), but instead it was decided to stupidly emit to update the palette after the corresponding operations (since cleaning is put after mousePressEvent in the event loop).

P.S. No problems with memory leaks of mPaletteElements and mPaletteItems were found, they are cleaned when QTreeWidget::clear() is called. However, they have problems with hashing.

@iakov
Copy link
Member

iakov commented Jul 22, 2024

Ok, let's postpone the proper fix with #1748 .

@iakov iakov added this to the 2023.2 milestone Jul 22, 2024
@iakov iakov merged commit 06e1c23 into trikset:master Jul 22, 2024
15 of 17 checks passed
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.

2 participants