diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/vclmain.hxx | 8 | ||||
-rw-r--r-- | include/vcl/vclptr.hxx | 15 |
2 files changed, 22 insertions, 1 deletions
diff --git a/include/vcl/vclmain.hxx b/include/vcl/vclmain.hxx index f58b259a761c..54a630c43223 100644 --- a/include/vcl/vclmain.hxx +++ b/include/vcl/vclmain.hxx @@ -12,6 +12,10 @@ #include <sal/config.h> +#ifdef DBG_UTIL +#include <vcl/dllapi.h> +#endif + namespace vclmain { // Function called from vclmain's implementation of main, needs to be @@ -19,7 +23,9 @@ namespace vclmain { // instance of Application (where the Application constructor takes care to link // that instance to ImplSVData.mpApp): void createApplication(); - +#ifdef DBG_UTIL +VCL_DLLPUBLIC bool isAlive(); +#endif } #endif diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx index 12cbb28b3ab5..906cd788c2af 100644 --- a/include/vcl/vclptr.hxx +++ b/include/vcl/vclptr.hxx @@ -29,6 +29,12 @@ #include <utility> #include <type_traits> +#ifdef DBG_UTIL +#ifndef WNT +#include <vcl/vclmain.hxx> +#endif +#endif + /// @cond INTERNAL namespace vcl { namespace detail { @@ -136,6 +142,15 @@ public: { } +#ifdef DBG_UTIL +#ifndef WNT + virtual ~VclPtr() + { + assert(m_rInnerRef.get() == nullptr || vclmain::isAlive()); + } +#endif +#endif + /** * A construction helper for VclPtr. Since VclPtr types are created * with a reference-count of one - to help fit into the existing |