-
Notifications
You must be signed in to change notification settings - Fork 38.7k
fixes #1522: GUI Disappearing (Mac OSX) #2530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)