Re: Not used QPointers showing modal dialogs via exec() - No crash

2013-11-12 Thread Thomas Lübking
On Dienstag, 12. November 2013 08:24:30 CEST, Harsh Kumar wrote: 1. If there is some code after exec() then code will crash as the QObject has been deleted. As long as there's no reference to any (pot.) freed memory, code after the nested eventloop is in general no problem (ie. you can still p

Re: Not used QPointers showing modal dialogs via exec() - No crash

2013-11-11 Thread Harsh Kumar
On 11/12/13, Thomas Lübking wrote: > On Montag, 11. November 2013 19:42:13 CEST, Kevin Krammer wrote: > >> If anything, D-Bus, timer, whatever, causes deletion of the >> dialog's parent, >> in this case KMinesMainWindow, then it will delete its child QObject. > > If a QObject with children on the

Re: Not used QPointers showing modal dialogs via exec() - No crash

2013-11-11 Thread Thomas Lübking
On Montag, 11. November 2013 19:42:13 CEST, Kevin Krammer wrote: If anything, D-Bus, timer, whatever, causes deletion of the dialog's parent, in this case KMinesMainWindow, then it will delete its child QObject. If a QObject with children on the stack gets deleted, you're in trouble anyway,

Re: Not used QPointers showing modal dialogs via exec() - No crash

2013-11-11 Thread Kevin Krammer
On Monday, 2013-11-11, 15:53:15, Daniel Nicoletti wrote: > This check is to prevent issues, if someone in the future changes > the code to do something after exec() then it's very likely to > crash due to the caller or it's child stuff already being deleted. > If you don't do anything after exec()

Re: Not used QPointers showing modal dialogs via exec() - No crash

2013-11-11 Thread Albert Astals Cid
El Dilluns, 11 de novembre de 2013, a les 23:13:51, Harsh Kumar va escriure: > Hi, > > I have a question: > > Krazy2 flags this issue in KMines - Not using QPointers when showing > modal dialogs via exec() > See: http://ebn.kde.org/krazy/reports/kde-4.x/kdegames/kmines/index.html > > Following i

Re: Not used QPointers showing modal dialogs via exec() - No crash

2013-11-11 Thread Daniel Nicoletti
This check is to prevent issues, if someone in the future changes the code to do something after exec() then it's very likely to crash due to the caller or it's child stuff already being deleted. If you don't do anything after exec() and the function was called by the event loop you are probably sa

Not used QPointers showing modal dialogs via exec() - No crash

2013-11-11 Thread Harsh Kumar
Hi, I have a question: Krazy2 flags this issue in KMines - Not using QPointers when showing modal dialogs via exec() See: http://ebn.kde.org/krazy/reports/kde-4.x/kdegames/kmines/index.html Following is the function to display High Scores dialog where the problem has been flagged: void KMinesMa