From 8fe2308b34c444f74fed453133e0ada34ed9dd23 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 3 Jul 2011 20:53:56 +0200 Subject: windows build fixes --- src/qt/bitcoin.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'src/qt/bitcoin.cpp') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 397af5fd38..78a20c51c0 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -113,21 +113,23 @@ int main(int argc, char *argv[]) { if(AppInit2(argc, argv)) { - BitcoinGUI window; - ClientModel clientModel(pwalletMain); - WalletModel walletModel(pwalletMain); - guiref = &window; - window.setClientModel(&clientModel); - window.setWalletModel(&walletModel); - - window.show(); - - int retval = app.exec(); - - guiref = 0; + { + // Put this in a block, so that BitcoinGUI is cleaned up properly before + // calling shutdown. + BitcoinGUI window; + ClientModel clientModel(pwalletMain); + WalletModel walletModel(pwalletMain); + guiref = &window; + window.setClientModel(&clientModel); + window.setWalletModel(&walletModel); + + window.show(); + + app.exec(); + + guiref = 0; + } Shutdown(NULL); - - return retval; } else { @@ -138,4 +140,5 @@ int main(int argc, char *argv[]) } catch (...) { PrintException(NULL, "Runaway exception"); } + return 0; } -- cgit v1.2.3