Skip to content

Commit

Permalink
Two bug fixes:
Browse files Browse the repository at this point in the history
    - fix Call::~Call when an exception is thrown
    - fix case where measure paint device's device has no painter
  • Loading branch information
Koen Deforche committed Sep 8, 2014
1 parent 51a27fe commit 27107e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/Wt/Dbo/Call
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public:
* This executes the call if it wasn't run() yet, and the call has not
* been copied.
*/
~Call();
~Call() WT_CXX11ONLY(noexcept(false));

/*! \brief Copy constructor.
*
Expand All @@ -47,6 +47,11 @@ public:
*/
template<typename T> Call& bind(const T& value);

/*! \brief Runs the database call.
*
* This may throw an exception if there was a problem with the SQL
* command.
*/
void run();

private:
Expand Down
2 changes: 1 addition & 1 deletion src/Wt/Dbo/Call.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Wt {
namespace Dbo {

Call::~Call()
Call::~Call() WT_CXX11ONLY(noexcept(false))
{
if (!copied_ && !run_)
run();
Expand Down
2 changes: 0 additions & 2 deletions src/Wt/WMeasurePaintDevice.C
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ WFlags<WPaintDevice::FeatureFlag> WMeasurePaintDevice::features() const
void WMeasurePaintDevice::init()
{
if (!device_->painter()) {
painter_ = new WPainter();
device_->setPainter(painter_);
} else
device_->painter()->save();
Expand All @@ -37,7 +36,6 @@ void WMeasurePaintDevice::done()
{
if (painter_ == device_->painter()) {
device_->setPainter(0);
delete painter_;
} else
device_->painter()->restore();
}
Expand Down

0 comments on commit 27107e8

Please sign in to comment.