Skip to content

Conversation

@jonasschnelli
Copy link
Contributor

  • 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

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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]>
@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/4d17a1b0c29e8fd8510c75db1efb203b9b4f9eb0 for binaries and test log.
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

@laanwj
Copy link
Member

laanwj commented Apr 18, 2013

ACK after squashing into one commit

@Diapolo
Copy link

Diapolo commented Apr 26, 2013

@laanwj ping :)

laanwj added a commit that referenced this pull request Apr 27, 2013
@laanwj laanwj merged commit 63888d4 into bitcoin:master Apr 27, 2013
laudney pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request Mar 19, 2014
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants