summaryrefslogtreecommitdiff
path: root/include/tools/ref.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-03 10:39:28 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-10-09 08:18:24 +0000
commita0a919d2b541c415ad9b81d2ee91895bf106e9bb (patch)
tree63d5c644ee8a8880d26ef6a77afb19f4e2151bdb /include/tools/ref.hxx
parent22a5357484f9a31a99146b738a8716a24bf59b3a (diff)
remove SvRefBase::QueryDelete
Move it's functionality into the only place that needs it, in the dbase driver. Removes an extra virtual call from a widely used class. The dbase driver seems to be using to perform some kind of whacky object recycling, so it's not like we want this functionality to be used somewhere else. Change-Id: I41018f71e0b0a79fdd3d527536f0ac95c788e614 Reviewed-on: https://gerrit.libreoffice.org/11786 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/tools/ref.hxx')
-rw-r--r--include/tools/ref.hxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx
index b18ce055081c..aecc2b379e00 100644
--- a/include/tools/ref.hxx
+++ b/include/tools/ref.hxx
@@ -26,6 +26,10 @@
#include <tools/toolsdllapi.h>
#include <vector>
+/**
+ This implements similar functionality to boost::intrusive_ptr
+*/
+
namespace tools {
/** T must be a class that extends SvRefBase */
@@ -152,7 +156,6 @@ class TOOLS_DLLPUBLIC SvRefBase
protected:
virtual ~SvRefBase();
- virtual void QueryDelete();
public:
SvRefBase() : bNoDelete(1), nRefCount(0) {}
@@ -183,7 +186,13 @@ public:
{
assert( nRefCount >= 1);
if( --nRefCount == 0 && !bNoDelete)
- QueryDelete();
+ {
+ // I'm not sure about the original purpose of this line, but right now
+ // it serves the purpose that anything that attempts to do an AddRef()
+ // after an object is deleted will trip an assert.
+ nRefCount = 1 << 30;
+ delete this;
+ }
}
unsigned int GetRefCount() const