fixes #1522: GUI Disappearing (Mac OSX)#2530
Conversation
jonasschnelli
commented
Apr 14, 2013
- this solution works stable on mac and ensures that the window get's reopened when the user clicks the dock icon .
- tested on 10.8 with Qt4.8.4 and Qt5.0.1
There was a problem hiding this comment.
possible pointer leak here: when is the MacDocIconHandler freed? Does its scope extend beyond that of the main window? If so, you should do setMainWindow(NULL) in the destructor.
There was a problem hiding this comment.
It's a singleton, ... it probably never gets freed during by the app itself.
But i just added this->mainWindow = NULL; in the destructor.
There was a problem hiding this comment.
I think you misunderstand me. What I mean is to set the mainwindow of your
singleton to NULL in the destructor of the MainWindow. This prevents a
stale pointer in your singleton after MainWindow is freed but the singleton
still lives.
There was a problem hiding this comment.
Ah. Clear. Your right. Did update the code.
But i think the destructor of BitcoinGUI never gets called during the runtime.
But yes, the pointer MUST be set to NULL.
There was a problem hiding this comment.
The destructor of BitcoinGUI gets called when the object goes out of scope.
Feel free to verify this and prove me wrong (this would be a bug).
The proper idiom here would be a "weak pointer". But explicitly setting it
to null to prevent a dangling pointer is ok.
- this solution works stable on mac and ensures that the window get's reopened when the user clicks the dock icon . - tested on 10.8 with Qt4.8.4 and Qt5.0.1 Signed-off-by: Jonas Schnelli <[email protected]>
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/4d17a1b0c29e8fd8510c75db1efb203b9b4f9eb0 for binaries and test log. |
|
ACK after squashing into one commit |
|
@laanwj ping :) |
fixes #1522: GUI Disappearing (Mac OSX)
fixes bitcoin#1522: GUI Disappearing (Mac OSX)