summaryrefslogtreecommitdiffstats
path: root/source/core/smart-pointer.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/smart-pointer.h')
-rw-r--r--source/core/smart-pointer.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/core/smart-pointer.h b/source/core/smart-pointer.h
index abd7763ee..dd00acabd 100644
--- a/source/core/smart-pointer.h
+++ b/source/core/smart-pointer.h
@@ -32,23 +32,25 @@ namespace Slang
virtual ~RefObject()
{}
- void addReference()
+ UInt addReference()
{
- referenceCount++;
+ return ++referenceCount;
}
- void decreaseReference()
+ UInt decreaseReference()
{
- --referenceCount;
+ return --referenceCount;
}
- void releaseReference()
+ UInt releaseReference()
{
SLANG_ASSERT(referenceCount != 0);
if(--referenceCount == 0)
{
delete this;
+ return 0;
}
+ return referenceCount;
}
bool isUniquelyReferenced()