[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-games-devel
Subject:    Palapeli - MergeGroup and Teleport
From:       Christian Ehrlicher <Ch.Ehrlicher () gmx ! de>
Date:       2017-09-10 10:08:20
Message-ID: 1dc2ef4b-0bea-611a-babc-243da20ff270 () gmx ! de
[Download RAW message or body]

Hi,

Palapeli crashes when a piece which gets merged is teleported to another 
scene. To trigger this in a reproducible way, increase the animation 
time in MergeGroup::start() to e.g. 2000ms to have time to start the 
teleport.
Then create a new view and make sure to mark it as destination of the 
teleport. After this start a merge and while the merge is ongoing, 
teleport this piece to the other view.
You'll get a crash either in GamePlay::updateSavedGame(), 
GamePlay::transferPieces(), SelectPieceInteractor::stopInteraction(), 
... everywhere when accessing the piece in the destination view.

I've three possible solutions:
- avoid a teleport during a ongoing merge
- make sure to get informed when a Piece is destroyed (Piece is derived 
from QObject so it should be easy)
- use QPointer<> instead raw pointers and check for != nullptr before 
accessing the piece in everywhere

The first one would avoid the crash but I think the other two would also 
help to prevent the crashes in the bugtracker.

What do you think?

Christian
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic