summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-01-15 07:41:47 +0000
committerritsuka <[email protected]>2015-01-15 07:41:47 +0000
commit2e1d9c41edc36776e8f28abce06a131c581153c7 (patch)
treee69f79fbec597ecdeb68d65ea48179898c221e73 /macosx
parent9f453c3ba77cc732bad75b33571ed05c9c5f2cb6 (diff)
MacGui: fix some leaks
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6753 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBAudio.h8
-rw-r--r--macosx/HBAudio.m27
-rw-r--r--macosx/HBJob.m3
-rw-r--r--macosx/HBSubtitles.h9
-rw-r--r--macosx/HBSubtitles.m21
5 files changed, 59 insertions, 9 deletions
diff --git a/macosx/HBAudio.h b/macosx/HBAudio.h
index 07ed536fc..3299c2130 100644
--- a/macosx/HBAudio.h
+++ b/macosx/HBAudio.h
@@ -21,8 +21,6 @@
@property (nonatomic, readwrite, retain) HBAudioDefaults *defaults;
-@property (nonatomic, readwrite) int container; // initially is the default HB_MUX_MP4
-
- (void)addAllTracks;
- (void)removeAll;
- (void)reloadDefaults;
@@ -31,6 +29,12 @@
- (void)settingTrackToNone:(HBAudioTrack *)newNoneTrack;
- (void)switchingTrackFromNone:(HBAudioTrack *)noLongerNoneTrack;
+/**
+ * For internal use
+ */
+
+- (void)containerChanged:(int)container;
+
@end
@interface HBAudio (KVC)
diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m
index 0d5363e41..df09a85be 100644
--- a/macosx/HBAudio.m
+++ b/macosx/HBAudio.m
@@ -15,6 +15,12 @@
#include "hb.h"
+@interface HBAudio ()
+
+@property (nonatomic, readwrite) int container; // initially is the default HB_MUX_MP4
+
+@end
+
@implementation HBAudio
- (instancetype)initWithTitle:(HBTitle *)title
@@ -41,6 +47,23 @@
return self;
}
+- (void)dealloc
+{
+ [_tracks release];
+ _tracks = nil;
+
+ [_defaults release];
+ _defaults = nil;
+
+ [_noneTrack release];
+ _noneTrack = nil;
+
+ [_masterTrackArray release];
+ _masterTrackArray = nil;
+
+ [super dealloc];
+}
+
- (void)addAllTracks
{
[self addTracksFromDefaults:YES];
@@ -312,9 +335,9 @@
}
// This gets called whenever the video container changes.
-- (void)setContainer:(int)container
+- (void)containerChanged:(int)container
{
- _container = container;
+ self.container = container;
// Update each of the instances because this value influences possible settings.
for (HBAudioTrack *audioObject in self.tracks)
diff --git a/macosx/HBJob.m b/macosx/HBJob.m
index 0222a0b33..d23bb6039 100644
--- a/macosx/HBJob.m
+++ b/macosx/HBJob.m
@@ -92,7 +92,8 @@ NSString *HBContainerChangedNotification = @"HBContainerChangedNotificatio
{
_container = container;
- self.audio.container = container;
+ [self.audio containerChanged:container];
+ [self.subtitles containerChanged:container];
[self.video containerChanged];
/* post a notification for any interested observers to indicate that our video container has changed */
diff --git a/macosx/HBSubtitles.h b/macosx/HBSubtitles.h
index ae7421b7b..ac8483f63 100644
--- a/macosx/HBSubtitles.h
+++ b/macosx/HBSubtitles.h
@@ -48,10 +48,15 @@ extern NSString *keySubTrackLanguageIndex;
@property (nonatomic, readonly) NSArray *languagesArray;
@property (nonatomic, readonly) NSInteger languagesArrayDefIndex;
-@property (nonatomic, readwrite) int container; // initially is the default HB_MUX_MP4
-
@property (nonatomic, readwrite, retain) HBSubtitlesDefaults *defaults;
+/**
+ * For internal use
+ */
+
+- (void)containerChanged:(int)container;
+@property (nonatomic, readwrite) int container; // initially is the default HB_MUX_MP4
+
@end
@interface HBSubtitles (KVC)
diff --git a/macosx/HBSubtitles.m b/macosx/HBSubtitles.m
index 6d982cdcc..37e71ea9b 100644
--- a/macosx/HBSubtitles.m
+++ b/macosx/HBSubtitles.m
@@ -85,6 +85,23 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex";
return self;
}
+- (void)dealloc
+{
+ [_tracks release];
+ _tracks = nil;
+
+ [_defaults release];
+ _defaults = nil;
+
+ [_masterTrackArray release];
+ _masterTrackArray = nil;
+
+ [_foreignAudioSearchTrackName release];
+ _foreignAudioSearchTrackName = nil;
+
+ [super dealloc];
+}
+
- (void)addAllTracks
{
[self.tracks removeAllObjects];
@@ -115,9 +132,9 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex";
}
// This gets called whenever the video container changes.
-- (void)setContainer:(int)container
+- (void)containerChanged:(int)container
{
- _container = container;
+ self.container = container;
[self validatePassthru];
}