You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2016/08/04 22:00:57 UTC

cordova-plugin-contacts git commit: CB-11667 - Memory leak in CDVContact for CoreFoundation ABRecordRef

Repository: cordova-plugin-contacts
Updated Branches:
  refs/heads/master 254083d59 -> c7c69d59c


CB-11667 - Memory leak in CDVContact for CoreFoundation ABRecordRef

 This closes #132


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/c7c69d59
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/c7c69d59
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/c7c69d59

Branch: refs/heads/master
Commit: c7c69d59cd8e5ab5ee97f6a2f535ad30653d6588
Parents: 254083d
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Aug 3 17:49:40 2016 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu Aug 4 15:04:04 2016 -0700

----------------------------------------------------------------------
 src/ios/CDVContact.m | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/c7c69d59/src/ios/CDVContact.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVContact.m b/src/ios/CDVContact.m
index a1dd85d..676ba5e 100644
--- a/src/ios/CDVContact.m
+++ b/src/ios/CDVContact.m
@@ -69,6 +69,15 @@ static NSDictionary* org_apache_cordova_contacts_defaultFields = nil;
     return record;
 }
 
+/* for CoreFoundation types, we need to still manually memory manage under ARC */
+- (void) dealloc
+{
+    if (record != NULL) {
+        CFRelease(record);
+        record = NULL;
+    }
+}
+
 /* Rather than creating getters and setters for each AddressBook (AB) Property, generic methods are used to deal with
  * simple properties,  MultiValue properties( phone numbers and emails) and MultiValueDictionary properties (Ims and addresses).
  * The dictionaries below are used to translate between the W3C identifiers and the AB properties.   Using the dictionaries,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org