summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-02-26 10:04:51 +0100
committerDamiano Galassi <[email protected]>2016-02-26 10:04:51 +0100
commitc3c1f6b8f4464c98369a2a127f771399d86c25ef (patch)
tree17054d3952c6ef2516564a5b8d8b64214d094423
parente06ab1d8cbed41d3adb9181d5e623c51c91a2222 (diff)
MacGui: make HBCore titles ivar always non null.
-rw-r--r--macosx/HBCore.h2
-rw-r--r--macosx/HBCore.m6
2 files changed, 5 insertions, 3 deletions
diff --git a/macosx/HBCore.h b/macosx/HBCore.h
index 6a50142ca..1c2ab306b 100644
--- a/macosx/HBCore.h
+++ b/macosx/HBCore.h
@@ -130,7 +130,7 @@ typedef void (^HBCoreCompletionHandler)(HBCoreResult result);
/**
* An array of HBTitles found by the latest scan.
*/
-@property (nonatomic, readonly, nullable) NSArray<HBTitle *> *titles;
+@property (nonatomic, readonly, copy) NSArray<HBTitle *> *titles;
/**
* This function converts an image created by libhb (specified via index)
diff --git a/macosx/HBCore.m b/macosx/HBCore.m
index 4e084df0b..3c2ac0b8b 100644
--- a/macosx/HBCore.m
+++ b/macosx/HBCore.m
@@ -45,7 +45,7 @@ static void hb_error_handler(const char *errmsg)
@property (nonatomic, readonly) dispatch_queue_t updateTimerQueue;
/// Current scanned titles.
-@property (nonatomic, readwrite, strong) NSArray<HBTitle *> *titles;
+@property (nonatomic, readwrite, copy) NSArray<HBTitle *> *titles;
/// Progress handler.
@property (nonatomic, readwrite, copy) HBCoreProgressHandler progressHandler;
@@ -96,6 +96,8 @@ static void hb_error_handler(const char *errmsg)
_name = @"HBCore";
_state = HBStateIdle;
_updateTimerQueue = dispatch_queue_create("fr.handbrake.coreQueue", DISPATCH_QUEUE_SERIAL);
+ _titles = @[];
+
_hb_state = malloc(sizeof(struct hb_state_s));
_logLevel = level;
@@ -197,7 +199,7 @@ static void hb_error_handler(const char *errmsg)
NSAssert(url, @"[HBCore scanURL:] called with nil url.");
// Reset the titles array
- self.titles = nil;
+ self.titles = @[];
// Copy the progress/completion blocks
self.progressHandler = progressHandler;