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

Rapidly deleting objects on a map causes crashing #1933

Closed
kralle333 opened this Issue Apr 18, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@kralle333
Copy link
Contributor

kralle333 commented Apr 18, 2018

Crash happens when you hold delete and rapidly delete objects on a map (nullptr exception).
The problem, as far as I tell, happens when selected objects are being synchronized, but their objectGroup has already been deleted.

For example:
Happens in MapObjectOutline::syncWithMapObject when the total offset is retrieved from the object's objectgroup

@bjorn

This comment has been minimized.

Copy link
Owner

bjorn commented Apr 18, 2018

Are you able to make a backtrace of this crash?

@bjorn bjorn added the bug label Apr 18, 2018

@kralle333

This comment has been minimized.

Copy link
Contributor

kralle333 commented Apr 20, 2018

tiled.dll!Tiled::Layer::totalOffset() Line 143 C++
tiled.exe!Tiled::Internal::MapObjectOutline::syncWithMapObject(Tiled::MapRenderer * renderer) Line 174 C++
tiled.exe!Tiled::Internal::ObjectSelectionItem::addRemoveObjectOutlines() Line 612 C++
tiled.exe!Tiled::Internal::ObjectSelectionItem::selectedObjectsChanged() Line 384 C++
tiled.exe!QtPrivate::FunctorCall<QtPrivate::IndexesList<>,QtPrivate::List<>,void,void (__thiscall Tiled::Internal::ObjectSelectionItem::)(void)>::call(void(Tiled::Internal::ObjectSelectionItem::)() f, Tiled::Internal::ObjectSelectionItem * o, void * * arg) Line 136 C++
tiled.exe!QtPrivate::FunctionPointer<void (_thiscall Tiled::Internal::ObjectSelectionItem::)(void)>::call<QtPrivate::List<>,void>(void(Tiled::Internal::ObjectSelectionItem::)() f, Tiled::Internal::ObjectSelectionItem * o, void * * arg) Line 169 C++
tiled.exe!QtPrivate::QSlotObject<void (thiscall Tiled::Internal::ObjectSelectionItem::*)(void),QtPrivate::List<>,void>::impl(int which, QtPrivate::QSlotObjectBase * this, QObject * r, void * * a, bool * ret) Line 120 C++
Qt5Cored.dll!663c720f() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for Qt5Cored.dll]
Qt5Cored.dll!663b9ce1() Unknown
Qt5Cored.dll!663b97f1() Unknown
tiled.exe!Tiled::Internal::MapDocument::selectedObjectsChanged() Line 600 C++
tiled.exe!Tiled::Internal::MapDocument::setSelectedObjects(const QList<Tiled::MapObject *> & selectedObjects) Line 799 C++
tiled.exe!Tiled::Internal::ObjectSelectionTool::startMoving(const QPointF & pos, QFlags modifiers) Line 1108 C++
tiled.exe!Tiled::Internal::ObjectSelectionTool::mouseMoved(const QPointF & pos, QFlags modifiers) Line 486 C++
tiled.exe!Tiled::Internal::MapScene::mouseMoveEvent(QGraphicsSceneMouseEvent * mouseEvent) Line 355 C++
Qt5Widgetsd.dll!6481cd43() Unknown
Qt5Guid.dll!0fc9fabb() Unknown
Qt5Guid.dll!0fc9e7e6() Unknown
Qt5Widgetsd.dll!643da19b() Unknown
Qt5Widgetsd.dll!643d644d() Unknown
Qt5Cored.dll!66372adc() Unknown
Qt5Cored.dll!66494bc8() Unknown
Qt5Widgetsd.dll!643d3d01() Unknown
Qt5Widgetsd.dll!64859b90() Unknown
Qt5Widgetsd.dll!6485708c() Unknown
tiled.exe!Tiled::Internal::MapView::mouseMoveEvent(QMouseEvent * event) Line 389 C++
Qt5Widgetsd.dll!6441d2d1() Unknown
Qt5Widgetsd.dll!6453cae2() Unknown
Qt5Widgetsd.dll!645475a3() Unknown
Qt5Widgetsd.dll!64855f1d() Unknown
Qt5Widgetsd.dll!643d1448() Unknown
Qt5Widgetsd.dll!6454b099() Unknown
Qt5Cored.dll!663735b7() Unknown
Qt5Widgetsd.dll!643da17c() Unknown
Qt5Widgetsd.dll!643d69b7() Unknown
Qt5Widgetsd.dll!6472511b() Unknown
Qt5Widgetsd.dll!64725ecd() Unknown
Qt5Guid.dll!0fca0c31() Unknown
Qt5Guid.dll!0fca7703() Unknown
Qt5Cored.dll!66372adc() Unknown
Qt5Cored.dll!66494bc8() Unknown
Qt5Widgetsd.dll!643dbe43() Unknown
Qt5Widgetsd.dll!64454946() Unknown
Qt5Widgetsd.dll!6445386f() Unknown
Qt5Widgetsd.dll!643da19b() Unknown
Qt5Widgetsd.dll!643d644d() Unknown
Qt5Widgetsd.dll!643c0bdb() Unknown
Qt5Widgetsd.dll!643c0b2f() Unknown
Qt5Widgetsd.dll!643b8509() Unknown
Qt5Widgetsd.dll!643b88eb() Unknown
[External Code]
Qt5Cored.dll!66372adc() Unknown
Qt5Cored.dll!66494bc8() Unknown
Qt5Guid.dll!0fce4da0() Unknown
Qt5Guid.dll!0fce6ed9() Unknown
Qt5Guid.dll!0fcb37a9() Unknown
qwindowsd.dll!05b3273d() Unknown
Qt5Cored.dll!6640c432() Unknown
[External Code]
Qt5Widgetsd.dll!647ed74a() Unknown
Qt5Guid.dll!0fc9fabb() Unknown
Qt5Guid.dll!0fc9e7e6() Unknown
Qt5Widgetsd.dll!6441db03() Unknown
Qt5Widgetsd.dll!64559451() Unknown
Qt5Widgetsd.dll!6467f9bb() Unknown
Qt5Widgetsd.dll!64534638() Unknown
Qt5Widgetsd.dll!6452a5f0() Unknown
Qt5Widgetsd.dll!643d00cf() Unknown
Qt5Widgetsd.dll!643e7b51() Unknown
Qt5Widgetsd.dll!64613335() Unknown
[External Code]
qwindowsd.dll!05ac1c77() Unknown
Qt5Cored.dll!6636de5c() Unknown
Qt5Cored.dll!6636e067() Unknown
Qt5Cored.dll!66370d92() Unknown
Qt5Guid.dll!0fce2ce8() Unknown
Qt5Widgetsd.dll!643d60a9() Unknown
tiled.exe!main(int argc, char * * argv) Line 428 C++
tiled.exe!WinMain(HINSTANCE
* formal, HINSTANCE * __formal, char * __formal, int __formal) Line 104 C++
[External Code]

@bjorn

This comment has been minimized.

Copy link
Owner

bjorn commented Apr 24, 2018

The exact steps to reproduce this issue are:

  • Click-and-hold an object
  • Press Delete to delete it, but hold the mouse button
  • Drag the mouse

It crashes, because it remembered the clicked object, and when you drag the mouse it tries to move it, but in the meantime this object has been deleted, causing the crash.

I'll need to make sure to invalidate the clicked object pointer as necessary, when objects (or their layer) are deleted.

@bjorn bjorn closed this in 752e4df Apr 25, 2018

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