Regression: QColorDialog crash on Mac when accepting with keyboard
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>
Tue, 28 Jul 2009 13:54:20 +0000 (15:54 +0200)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>
Tue, 28 Jul 2009 13:59:21 +0000 (15:59 +0200)
commitb0482e0b13ea3c20674515ffdafb66c14231cc56
tree2f1c00258544d473b65f1b1d1fdcbf31cac46fd9
parentac92e906114ed7216cfd99e0deecfb7be0fd91ec
Regression: QColorDialog crash on Mac when accepting with keyboard

Basically, the crash happends because we release the dialog when
the ok button is clicked. But when the button is clicked with the
keyboard (actually cocoa emulates a click when pressing enter), it
also tries to do some focus handling on the button afterwards. But
at that point, the button is already freed up. With a crash as the
result. This patch goes through a lot of the code, and rewrites it
so we doesnt free up the cocoa objects before the destructor of
the QColorDialog is called.

Task-number: 258445
Reviewed-by: msorvig
src/gui/dialogs/qcolordialog.cpp
src/gui/dialogs/qcolordialog_mac.mm
src/gui/dialogs/qcolordialog_p.h