summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;