Bonjour à tour,
me revoilà avec un nouveau problème des plus étranges...
Soient :
1 classe héritant de QApplication app
1 classe héritant de QObject AlertController
1 classe héritant de QDialog AlertDialog
l'instance de app contient un attribut alertController_ instancié sur la pile (dans les attributs)
AlertController contient un attribut alertDialog_ instancié idem.
app appelle alertController pour afficher une alerte.
alertController prépare la dialog et l'affiche (show())
si je quitte app alors que la dialog est ouverte j'ai le crash suivant (read access violation) :
Si le dialog n'est pas ouvert... je n'ai pas ce problème.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 0 QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> >::data qscopedpointer.h 135 0x6e1a55ca 1 qGetPtrHelper<QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData> > > qglobal.h 2428 0x6e193cbb 2 QApplication::d_func qapplication.h 390 0x6e19e173 3 QWidget::~QWidget qwidget.cpp 1629 0x6e22a88b 4 QDialog::~QDialog qdialog.cpp 327 0x6e847cf8 5 AlertDialog::~AlertDialog AlertDialog.cpp 45 0xd77b63 6 AlertsController::~AlertsController AlertsController.cpp 16 0xd76e3e 7 AlertsController::`scalar deleting destructor' A2 0xd7762f 8 QObjectPrivate::deleteChildren qobject.cpp 1908 0x7091b1f9 9 QWidget::~QWidget qwidget.cpp 1679 0x6e22a976 10 QMainWindow::~QMainWindow qmainwindow.cpp 389 0x6e767d12 11 MainWindowController::~MainWindowController MainWindowController.cpp 95 0xd81acd 12 MainAppController::~MainAppController MainAppController.cpp 22 0xd71a23 13 MainAppController::`scalar deleting destructor' A2 0xd733af 14 QObjectPrivate::deleteChildren qobject.cpp 1908 0x7091b1f9 15 QObject::~QObject qobject.cpp 929 0x70919cb8 16 QCoreApplication::~QCoreApplication qcoreapplication.cpp 792 0x708fbc6d 17 QApplication::~QApplication qapplication.cpp 1222 0x6e1afbcc 18 QtSingleApplication::~QtSingleApplication A2 0xd3be10 19 A2Application::~A2Application A2Application.cpp 50 0xd39e0a 20 Loader::loadApplication Loader.cpp 37 0xd36257 21 main main.cpp 67 0xd36082 22 WinMain qtmain_win.cpp 131 0xdb68aa 23 __tmainCRTStartup crtexe.c 547 0xdb5e50 24 WinMainCRTStartup crtexe.c 371 0xdb5bdf 25 BaseThreadInitThunk kernel32 0x75ba33aa 26 __RtlUserThreadStart ntdll32 0x779a9ef2 27 _RtlUserThreadStart ntdll32 0x779a9ec5
Dans tous les cas suivants je n'ai pas le problème :
-j'utilise un timer qui ferme le dialog au bout de 5s
-je ferme le dialog à la main
-je n'affiche pas le dialog mais l'instancie quand même
Dans tous les cas suivants j'ai le problème :
-je laisse le dialog ouvert (pas de timer)
-je ferme l'application avant que le timer n'ait fermé le dialog
Ca fait 2h que je suis là dessus et google n'est pas mon ami... Alors que faire selon vous ??
Partager