diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2017-03-29 00:01:04 +0200 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2017-04-04 14:35:16 +0000 |
commit | 3ecb9b4bd7dc70664bbb8d7c957ea8dc5015223f (patch) | |
tree | 3446bd81bcd905833fb46f1660bb2d6e095d358b /include | |
parent | 0144600bf5b5d8093f6a720ad21df221f08bce9e (diff) |
tdf#99352: assert on stray VclPtrs past DeInit
- ignore on Windows for now, as it is acting up
Change-Id: I98dbb887ed556b58188870c3eb3de1327bc58109
Reviewed-on: https://gerrit.libreoffice.org/35816
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
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 |