mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-20 11:48:30 -06:00
There seems to be more than one problem that causes the exception handler ("catch") to get lost on Windows: * Throwing from a constructor called from a member function of another object of the same class. That's fixed here for the GncNumeric string constructor, but there's at least one other instance I'm still working on in GncNumeric::to_decimal. * Hidden memory allocation in a stack-allocated object like std::string, std::istringstream, or boost::smatch: The throw causes the object to go out of scope which calls its destructor and in that case the catch reference is either lost or never compiled in. This change ifdefs out the creation of detailed exception messages on Windows to avoid the destruction of the std::istringstream and its attached std::string, creates a series of helper functions to ensure that the boost::smatch is in a non-throwing scope, and puts the computed values directly into the member variables instead of delegating the construction to a temporary and then copying out the values. The last item is more correct anyway, as C++ constructor delegation is supposed to happen in the member initialization part rather than the function body. With these changes the exceptions from the GncNumeric string constructor are handled correctly. |
||
---|---|---|
.. | ||
app-utils | ||
backend | ||
core-utils | ||
doc | ||
engine | ||
gnc-module | ||
quotes | ||
scm | ||
tax | ||
CMakeLists.txt | ||
Makefile.am |