-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Tiled crashing due to double-deletion of Tilesets #3290
Comments
If you actually have a map with lots of tilesets, would you be able to share it for reproducing the problem? Or, if you have a script that sets up a map with lots of tilesets, could you share that? |
Here's a script+file to reproduce: Something I found out while trying to prepare this script:
Which might mean the crash is actually due to having tiles Out-of-Bounds, rather than having too many tilesets. |
So, the problem here is similar to #3292, though it's a bit of a different case. All the tilesets you've created are |
Don't return pointers of objects that are about to be deleted. Closes #3290
Don't use editable wrapper objects that are about to be deleted. In particular, avoid attempting to take ownership of them, which caused a double-deletion. Also detaching and attaching now only happens with editable wrapper objects that aren't marked for deletion. When an editable wrapper gets deleted, it now only removes itself from EditableManager::mEditables, whereas it could otherwise delete an entry for a more recently created editable wrapper. The QJSEngine::newQObject(object).isNull() check was replaced by the private API QQmlData::wasDeleted, since newQObject could crash when being called during script engine destruction. Closes #3290
Don't use editable wrapper objects that are about to be deleted. In particular, avoid attempting to take ownership of them, which caused a double-deletion. Also detaching and attaching now only happens with editable wrapper objects that aren't marked for deletion. When an editable wrapper gets deleted, it now only removes itself from EditableManager::mEditables, whereas it could otherwise delete an entry for a more recently created editable wrapper. The QJSEngine::newQObject(object).isNull() check was replaced by the private API QQmlData::wasDeleted, since newQObject could crash when being called during script engine destruction. Closes #3290
Describe the bug
Closing a map with a lot of tilesets causes Tiled to crash
To Reproduce
Expected behavior
Tiled should only close the map, and not crash.
Media
Backtrace:
Platform:
The text was updated successfully, but these errors were encountered: