aboutsummaryrefslogtreecommitdiff
path: root/src/stable
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2018-01-22 07:21:07 -0800
committerMike Buland <mbuland@penny-arcade.com>2018-01-22 07:21:07 -0800
commit9e745ddb102abaf65cd22ee2ee86a11367133609 (patch)
tree18cf0b98765e745b418d4c945104e9be61e850fc /src/stable
parent516fa9045af1e9c85ce524535d0ea5bc395e86cb (diff)
downloadlibbu++-9e745ddb102abaf65cd22ee2ee86a11367133609.tar.gz
libbu++-9e745ddb102abaf65cd22ee2ee86a11367133609.tar.bz2
libbu++-9e745ddb102abaf65cd22ee2ee86a11367133609.tar.xz
libbu++-9e745ddb102abaf65cd22ee2ee86a11367133609.zip
Added an unshare function to Bu::SharedCore.
It simply forces a hard copy, which means the instance you called this on will be independant of any other copies. It's something that should exist, but I'm not sure if unshare is the right name. It's in there now, though.
Diffstat (limited to 'src/stable')
-rw-r--r--src/stable/sharedcore.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/stable/sharedcore.h b/src/stable/sharedcore.h
index 9108294..e68cf21 100644
--- a/src/stable/sharedcore.h
+++ b/src/stable/sharedcore.h
@@ -113,6 +113,11 @@ namespace Bu
113 return dynamic_cast<const _SharedType &>(rOther).core == core; 113 return dynamic_cast<const _SharedType &>(rOther).core == core;
114 } 114 }
115 115
116 void unshare()
117 {
118 _hardCopy();
119 }
120
116 protected: 121 protected:
117 Core *core; 122 Core *core;
118 void _hardCopy() 123 void _hardCopy()