qt: Fix random segfault when closing "Choose data directory" dialog 364/head
authorWladimir J. van der Laan <laanwj@gmail.com>
Thu, 18 Aug 2016 14:58:04 +0000 (16:58 +0200)
committersvost <ya.nowa@yandex.ru>
Mon, 30 Jan 2017 16:18:00 +0000 (19:18 +0300)
commit7ecd4c94433c6233faaf8f6fb6eb89df23ee4f4b
tree575ddf09647853408435ca1213015a9e4bb3ebe7
parent6229d2798d9e3777a8afaf598c38ebf542ccf797
qt: Fix random segfault when closing "Choose data directory" dialog

The `pickDataDirectory()` function was calling `exit(0)` to quit
the application when the user closes the dialog without choosing
a data directory.

This is a bad idea because a background thread is created (to
check free space on the drive of the currently selected datadir).
The thread is not stopped and unwound properly, resulting in a potential
race condition somewhere deep in Qt.

So replace the `exit()` by a boolean return value, and let the
stack unwind normally.
src/qt/bitcoin.cpp
src/qt/intro.cpp
src/qt/intro.h