diff options
author | Daniel Elstner <danielk@openismus.com> | 2010-06-07 18:32:33 +0200 |
---|---|---|
committer | Daniel Elstner <danielk@openismus.com> | 2010-06-07 18:35:27 +0200 |
commit | 83bb42f4696fea74ce82a22cec6a2fa8aa8049bc (patch) | |
tree | e7cbee99d818bdf314c0461a5a34d8c50764c3a3 | |
parent | 2dbde9037d0376a665bbcd9a27c1b5c43670c42f (diff) |
Disallow copying of Cairo::Context objects
* cairomm/context.h (Cairo::Context): Declare a private copy
constructor and assignment operator in order to explicitly prevent
objects from being copied by value. That was never valid, and not
disallowing it seems to have been merely an oversight.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | cairomm/context.h | 10 |
2 files changed, 15 insertions, 4 deletions
@@ -1,5 +1,14 @@ 2010-06-07 Daniel Elstner <danielk@openismus.com> + Disallow copying of Cairo::Context objects + + * cairomm/context.h (Cairo::Context): Declare a private copy + constructor and assignment operator in order to explicitly prevent + objects from being copied by value. That was never valid, and not + disallowing it seems to have been merely an oversight. + +2010-06-07 Daniel Elstner <danielk@openismus.com> + Do not unnecessarily cast booleans to pointers * cairomm/fontface.cc (USER_DATA_KEY_DEFAULT_TEXT_TO_GLYPHS): Put diff --git a/cairomm/context.h b/cairomm/context.h index 774b213..24f5134 100644 --- a/cairomm/context.h +++ b/cairomm/context.h @@ -1041,19 +1041,21 @@ public: */ inline const cobject* cobj() const { return m_cobject; } - #ifndef DOXYGEN_IGNORE_THIS +#ifndef DOXYGEN_IGNORE_THIS ///For use only by the cairomm implementation. inline ErrorStatus get_status() const { return cairo_status(const_cast<cairo_t*>(cobj())); } void reference() const; void unreference() const; - #endif //DOXYGEN_IGNORE_THIS +#endif //DOXYGEN_IGNORE_THIS protected: - - cobject* m_cobject; + +private: + Context(const Context&); + Context& operator=(const Context&); }; } // namespace Cairo |