aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/basetypes/MCOperation.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/basetypes/MCOperation.cc')
-rw-r--r--src/core/basetypes/MCOperation.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/basetypes/MCOperation.cc b/src/core/basetypes/MCOperation.cc
index 71b3c52f..51497cba 100644
--- a/src/core/basetypes/MCOperation.cc
+++ b/src/core/basetypes/MCOperation.cc
@@ -15,6 +15,11 @@ Operation::Operation()
Operation::~Operation()
{
+#if __APPLE__
+ if (mCallbackDispatchQueue != NULL) {
+ dispatch_release(mCallbackDispatchQueue);
+ }
+#endif
pthread_mutex_destroy(&mLock);
}
@@ -73,7 +78,13 @@ void Operation::start()
#if __APPLE__
void Operation::setCallbackDispatchQueue(dispatch_queue_t callbackDispatchQueue)
{
+ if (mCallbackDispatchQueue != NULL) {
+ dispatch_release(mCallbackDispatchQueue);
+ }
mCallbackDispatchQueue = callbackDispatchQueue;
+ if (mCallbackDispatchQueue != NULL) {
+ dispatch_retain(mCallbackDispatchQueue);
+ }
}
dispatch_queue_t Operation::callbackDispatchQueue()