Surface memory leaks by logging the deallocation of view controllers.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent d72c4a21c3
commit f0cecfad11

@ -82,6 +82,7 @@
34D8C0281ED3673300188D7C /* DebugUITableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8C0261ED3673300188D7C /* DebugUITableViewController.m */; };
34D8C02B1ED3685800188D7C /* DebugUIContacts.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8C02A1ED3685800188D7C /* DebugUIContacts.m */; };
34D99C8E1F28DDCD00D284D6 /* OWSSwiftUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34D99C8D1F28DDCD00D284D6 /* OWSSwiftUtils.swift */; };
34D99C8C1F27B13B00D284D6 /* OWSViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D99C8B1F27B13B00D284D6 /* OWSViewController.m */; };
34DFCB851E8E04B500053165 /* AddToBlockListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34DFCB841E8E04B500053165 /* AddToBlockListViewController.m */; };
34E3E5681EC4B19400495BAC /* AudioProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34E3E5671EC4B19400495BAC /* AudioProgressView.swift */; };
34E3EF0D1EFC235B007F6822 /* DebugUIDiskUsage.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E3EF0C1EFC235B007F6822 /* DebugUIDiskUsage.m */; };
@ -510,6 +511,8 @@
34D8C0291ED3685800188D7C /* DebugUIContacts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugUIContacts.h; sourceTree = "<group>"; };
34D8C02A1ED3685800188D7C /* DebugUIContacts.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugUIContacts.m; sourceTree = "<group>"; };
34D99C8D1F28DDCD00D284D6 /* OWSSwiftUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSSwiftUtils.swift; sourceTree = "<group>"; };
34D99C8A1F27B13B00D284D6 /* OWSViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSViewController.h; sourceTree = "<group>"; };
34D99C8B1F27B13B00D284D6 /* OWSViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSViewController.m; sourceTree = "<group>"; };
34DFCB831E8E04B400053165 /* AddToBlockListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddToBlockListViewController.h; sourceTree = "<group>"; };
34DFCB841E8E04B500053165 /* AddToBlockListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddToBlockListViewController.m; sourceTree = "<group>"; };
34E3E5671EC4B19400495BAC /* AudioProgressView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioProgressView.swift; sourceTree = "<group>"; };
@ -997,6 +1000,8 @@
34B3F8631E8DF1700035BE1A /* OWSQRCodeScanningViewController.m */,
34B3F89D1E8DF5490035BE1A /* OWSTableViewController.h */,
34B3F89E1E8DF5490035BE1A /* OWSTableViewController.m */,
34D99C8A1F27B13B00D284D6 /* OWSViewController.h */,
34D99C8B1F27B13B00D284D6 /* OWSViewController.m */,
34B3F8641E8DF1700035BE1A /* PrivacySettingsTableViewController.h */,
34B3F8651E8DF1700035BE1A /* PrivacySettingsTableViewController.m */,
34B3F8661E8DF1700035BE1A /* RegistrationViewController.h */,
@ -2234,6 +2239,7 @@
45BB93381E688E14001E3939 /* UIDevice+featureSupport.swift in Sources */,
458DE9D61DEE3FD00071BB03 /* PeerConnectionClient.swift in Sources */,
451DE9FD1DC1A28200810E42 /* SyncPushTokensJob.swift in Sources */,
34D99C8C1F27B13B00D284D6 /* OWSViewController.m in Sources */,
45666F761D9BFE00008FE134 /* OWS100RemoveTSRecipientsMigration.m in Sources */,
340CB2271EAC25820001CAA1 /* UpdateGroupViewController.m in Sources */,
34B3F89F1E8DF5490035BE1A /* OWSTableViewController.m in Sources */,

@ -18,6 +18,7 @@
#import "OWSLogger.h"
#import "OWSMessageEditing.h"
#import "OWSProgressView.h"
#import "OWSViewController.h"
#import "OWSWebRTCDataProtos.pb.h"
#import "PrivacySettingsTableViewController.h"
#import "PropertyListPreferences.h"

@ -5,7 +5,7 @@
import Foundation
import MediaPlayer
class AttachmentApprovalViewController: UIViewController, OWSAudioAttachmentPlayerDelegate {
class AttachmentApprovalViewController: OWSViewController, OWSAudioAttachmentPlayerDelegate {
let TAG = "[AttachmentApprovalViewController]"

@ -2,8 +2,12 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "OWSViewController.h"
@interface BlockListViewController : UIViewController
NS_ASSUME_NONNULL_BEGIN
@interface BlockListViewController : OWSViewController
@end
NS_ASSUME_NONNULL_END

@ -8,7 +8,7 @@ import PromiseKit
// TODO: Add category so that button handlers can be defined where button is created.
// TODO: Ensure buttons enabled & disabled as necessary.
class CallViewController: UIViewController, CallObserver, CallServiceObserver, RTCEAGLVideoViewDelegate {
class CallViewController: OWSViewController, CallObserver, CallServiceObserver, RTCEAGLVideoViewDelegate {
let TAG = "[CallViewController]"

@ -2,10 +2,14 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "OWSViewController.h"
@interface CodeVerificationViewController : UIViewController
NS_ASSUME_NONNULL_BEGIN
@interface CodeVerificationViewController : OWSViewController
- (void)setVerificationCodeAndTryToVerify:(NSString *)verificationCode;
@end
NS_ASSUME_NONNULL_END

@ -34,7 +34,7 @@ public enum SubtitleCellValue {
}
@available(iOS 9.0, *)
open class ContactsPicker: UIViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate {
open class ContactsPicker: OWSViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate {
@IBOutlet var tableView: UITableView!
@IBOutlet var searchBar: UISearchBar!

@ -227,6 +227,9 @@ typedef enum : NSUInteger {
- (void)dealloc
{
// Surface memory leaks by logging the deallocation of view controllers.
DDLogVerbose(@"Dealloc: %@", self.class);
[[NSNotificationCenter defaultCenter] removeObserver:self];
}

@ -2,11 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface DomainFrontingCountryViewController : UIViewController
@interface DomainFrontingCountryViewController : OWSViewController
@end

@ -46,7 +46,7 @@ private class CallKitExperienceUpgradeViewController: ExperienceUpgradeViewContr
}
}
private class ExperienceUpgradeViewController: UIViewController {
private class ExperienceUpgradeViewController: OWSViewController {
let TAG = "[ExperienceUpgradeViewController]"
let header: String
@ -128,7 +128,7 @@ func setPageControlAppearance() {
}
}
class ExperienceUpgradesPageViewController: UIViewController, UIPageViewControllerDataSource {
class ExperienceUpgradesPageViewController: OWSViewController, UIPageViewControllerDataSource {
let TAG = "[ExperienceUpgradeViewController]"

@ -2,9 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface FingerprintViewController : UIViewController
@interface FingerprintViewController : OWSViewController
+ (void)presentFromViewController:(UIViewController *)viewController recipientId:(NSString *)recipientId;

@ -2,9 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface FingerprintViewScanController : UIViewController
@interface FingerprintViewScanController : OWSViewController
- (void)configureWithRecipientId:(NSString *)recipientId NS_SWIFT_NAME(configure(recipientId:));

@ -2,12 +2,15 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "OWSMessageData.h"
#import "OWSViewController.h"
#import "TSAttachmentStream.h"
#import "TSInteraction.h"
#import "OWSMessageData.h"
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface FullImageViewController : UIViewController
@interface FullImageViewController : OWSViewController
- (instancetype)initWithAttachment:(TSAttachmentStream *)attachment
fromRect:(CGRect)rect
@ -18,3 +21,5 @@
- (void)presentFromViewController:(UIViewController *)viewController;
@end
NS_ASSUME_NONNULL_END

@ -12,6 +12,8 @@
#import "UIColor+OWS.h"
#import "AttachmentSharing.h"
NS_ASSUME_NONNULL_BEGIN
#define kMinZoomScale 1.0f
#define kMaxZoomScale 8.0f
@ -32,8 +34,7 @@
}
// We only use custom actions in UIMenuController.
- (BOOL)canPerformAction:(SEL)action
withSender:(id)sender
- (BOOL)canPerformAction:(SEL)action withSender:(nullable id)sender
{
return NO;
}
@ -459,7 +460,8 @@
#pragma mark - UIScrollViewDelegate
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
- (nullable UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return self.imageView;
}
@ -471,7 +473,8 @@
}
}
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale {
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(nullable UIView *)view atScale:(CGFloat)scale
{
self.scrollView.scrollEnabled = (scale > 1);
self.scrollView.contentInset = [self contentInsetForScrollView:scale];
}
@ -510,3 +513,5 @@
}
@end
NS_ASSUME_NONNULL_END

@ -2,9 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface MessageComposeTableViewController : UIViewController
@interface MessageComposeTableViewController : OWSViewController
@end

@ -3,10 +3,11 @@
//
#import "OWSConversationSettingsViewDelegate.h"
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface NewGroupViewController : UIViewController
@interface NewGroupViewController : OWSViewController
@property (nonatomic, weak) id<OWSConversationSettingsViewDelegate> delegate;

@ -1,13 +1,20 @@
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSQRCodeScanningViewController.h"
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@class OWSLinkedDevicesTableViewController;
@interface OWSLinkDeviceViewController : UIViewController <OWSQRScannerDelegate>
@interface OWSLinkDeviceViewController : OWSViewController <OWSQRScannerDelegate>
@property OWSLinkedDevicesTableViewController *linkedDevicesTableViewController;
- (void)controller:(OWSQRCodeScanningViewController *)controller didDetectQRCodeWithString:(NSString *)string;
@end
NS_ASSUME_NONNULL_END

@ -2,10 +2,13 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>
#import <ZXingObjC/ZXingObjC.h>
NS_ASSUME_NONNULL_BEGIN
@class OWSQRCodeScanningViewController;
@protocol OWSQRScannerDelegate
@ -20,10 +23,12 @@
#pragma mark -
@interface OWSQRCodeScanningViewController
: UIViewController <AVCaptureMetadataOutputObjectsDelegate, ZXCaptureDelegate>
: OWSViewController <AVCaptureMetadataOutputObjectsDelegate, ZXCaptureDelegate>
@property (nonatomic, weak) UIViewController<OWSQRScannerDelegate> *scanDelegate;
- (void)startCapture;
@end
NS_ASSUME_NONNULL_END

@ -7,6 +7,8 @@
#import "UIColor+OWS.h"
#import "UIView+OWS.h"
NS_ASSUME_NONNULL_BEGIN
@interface OWSQRCodeScanningViewController ()
@property (atomic) ZXCapture *capture;
@ -36,7 +38,7 @@
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (!self) {
@ -159,3 +161,5 @@
}
@end
NS_ASSUME_NONNULL_END

@ -2,7 +2,7 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@ -103,7 +103,7 @@ typedef UITableViewCell *_Nonnull (^OWSTableCustomCellBlock)();
#pragma mark -
@interface OWSTableViewController : UIViewController
@interface OWSTableViewController : OWSViewController
@property (nonatomic, weak) id<OWSTableViewControllerDelegate> delegate;

@ -0,0 +1,13 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface OWSViewController : UIViewController
@end
NS_ASSUME_NONNULL_END

@ -0,0 +1,19 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@implementation OWSViewController
- (void)dealloc
{
// Surface memory leaks by logging the deallocation of view controllers.
DDLogVerbose(@"Dealloc: %@", self.class);
}
@end
NS_ASSUME_NONNULL_END

@ -6,7 +6,7 @@ import Foundation
import WebRTC
import PromiseKit
class OversizeTextMessageViewController: UIViewController {
class OversizeTextMessageViewController: OWSViewController {
let TAG = "[OversizeTextMessageViewController]"

@ -2,11 +2,11 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface RegistrationViewController : UIViewController
@interface RegistrationViewController : OWSViewController
@end

@ -2,7 +2,7 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
@class ContactsViewHelper;
@interface SelectRecipientViewController : UIViewController
@interface SelectRecipientViewController : OWSViewController
@property (nonatomic, weak) id<SelectRecipientViewControllerDelegate> delegate;

@ -2,6 +2,8 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
@class TSThread;
NS_ASSUME_NONNULL_BEGIN
@ -20,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
// A base class for views used to pick a single signal user, either by
// entering a phone number or picking from your contacts.
@interface SelectThreadViewController : UIViewController
@interface SelectThreadViewController : OWSViewController
@property (nonatomic, weak) id<SelectThreadViewControllerDelegate> delegate;

@ -2,11 +2,12 @@
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSViewController.h"
#import <UIKit/UIKit.h>
@class TSThread;
@interface SignalsViewController : UIViewController
@interface SignalsViewController : OWSViewController
// TODO: Remove this property.
@property (nonatomic) BOOL newlyRegisteredUser;

@ -3,6 +3,7 @@
//
#import "OWSConversationSettingsViewDelegate.h"
#import "OWSViewController.h"
NS_ASSUME_NONNULL_BEGIN
@ -14,7 +15,7 @@ typedef NS_ENUM(NSUInteger, UpdateGroupMode) {
UpdateGroupMode_EditGroupAvatar,
};
@interface UpdateGroupViewController : UIViewController
@interface UpdateGroupViewController : OWSViewController
@property (nonatomic, weak) id<OWSConversationSettingsViewDelegate> conversationSettingsViewDelegate;

Loading…
Cancel
Save