diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-07-08 17:12:02 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-07-08 17:12:02 +0000 |
commit | bff7f2b3b440c30d0d6eb692576af57ef42edd1b (patch) | |
tree | 0ba45051db1ee7b7808339cfb587f8f76d8c7c5c /libdimensionxx/canvas.cpp | |
parent | 14c9cd86e1b7c6ff27c5000d72721c54a718daac (diff) | |
download | dimension-bff7f2b3b440c30d0d6eb692576af57ef42edd1b.tar.xz |
Comments and style adjustments, and a couple fixes.
Diffstat (limited to 'libdimensionxx/canvas.cpp')
-rw-r--r-- | libdimensionxx/canvas.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libdimensionxx/canvas.cpp b/libdimensionxx/canvas.cpp index 3ff9d32..6118730 100644 --- a/libdimensionxx/canvas.cpp +++ b/libdimensionxx/canvas.cpp @@ -24,7 +24,12 @@ namespace Dimension { // Allocate the canvas with dmnsn_new_canvas() Canvas::Canvas(unsigned int width, unsigned int height) - : m_canvas(new dmnsn_canvas*(dmnsn_new_canvas(width, height))) { } + : m_canvas(new dmnsn_canvas*(dmnsn_new_canvas(width, height))) + { + if (!dmnsn()) { + throw Dimension_Error("Couldn't allocate canvas."); + } + } // Wrap an existing dmnsn_canvas* Canvas::Canvas(dmnsn_canvas* canvas) |