Skip to content

Commit b6606a4

Browse files
author
xyl
committed
bug - 修复翻页造成的内存泄漏
Former-commit-id: a7c1960
1 parent ae7b68a commit b6606a4

19 files changed

+26756
-20
lines changed

LSYReader/.DS_Store

0 Bytes
Binary file not shown.

LSYReader/LSYReader.xcodeproj/project.pbxproj

+3-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
871E61CC1D1282B80047AAFE /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = 871E61C41D1282B80047AAFE /* unzip.c */; };
2828
871E61CD1D1282B80047AAFE /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 871E61C61D1282B80047AAFE /* zip.c */; };
2929
871E61CE1D1282B80047AAFE /* ZipArchive.mm in Sources */ = {isa = PBXBuildFile; fileRef = 871E61C91D1282B80047AAFE /* ZipArchive.mm */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
30-
871E61D01D128E900047AAFE /* 细说明朝.epub in Resources */ = {isa = PBXBuildFile; fileRef = 871E61CF1D1285EC0047AAFE /* 细说明朝.epub */; };
3130
871E61D31D12A6040047AAFE /* NSString+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 871E61D21D12A6040047AAFE /* NSString+HTML.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
3231
871E61D61D12A66A0047AAFE /* GTMNSString+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 871E61D51D12A66A0047AAFE /* GTMNSString+HTML.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
3332
8726DA4B1D07FF830072323A /* bt_tjcp_no@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8726DA4A1D07FF830072323A /* bt_tjcp_no@2x.png */; };
@@ -111,7 +110,6 @@
111110
871E61C71D1282B80047AAFE /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zip.h; sourceTree = "<group>"; };
112111
871E61C81D1282B80047AAFE /* ZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipArchive.h; sourceTree = "<group>"; };
113112
871E61C91D1282B80047AAFE /* ZipArchive.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ZipArchive.mm; sourceTree = "<group>"; };
114-
871E61CF1D1285EC0047AAFE /* 细说明朝.epub */ = {isa = PBXFileReference; lastKnownFileType = file; path = "细说明朝.epub"; sourceTree = "<group>"; };
115113
871E61D11D12A6040047AAFE /* NSString+HTML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+HTML.h"; sourceTree = "<group>"; };
116114
871E61D21D12A6040047AAFE /* NSString+HTML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+HTML.m"; sourceTree = "<group>"; };
117115
871E61D41D12A66A0047AAFE /* GTMNSString+HTML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTMNSString+HTML.h"; sourceTree = "<group>"; };
@@ -423,7 +421,6 @@
423421
ABE8ABDE1CFED82600693078 /* Resource */ = {
424422
isa = PBXGroup;
425423
children = (
426-
871E61CF1D1285EC0047AAFE /* 细说明朝.epub */,
427424
AB93D89B1DDCA43A0071DFBE /* 每天懂一点好玩心理学.epub */,
428425
ABE8ABD21CFE930F00693078 /* mdjyml.txt */,
429426
8726DA501D08021E0072323A /* sale_discount_yellow.png */,
@@ -469,7 +466,7 @@
469466
TargetAttributes = {
470467
AB9A96B61CFC2EE70066030C = {
471468
CreatedOnToolsVersion = 7.3;
472-
DevelopmentTeam = P348GLNLW8;
469+
DevelopmentTeam = WZSZ3VSE2H;
473470
};
474471
};
475472
};
@@ -497,7 +494,6 @@
497494
buildActionMask = 2147483647;
498495
files = (
499496
AB93D89C1DDCA44F0071DFBE /* 每天懂一点好玩心理学.epub in Resources */,
500-
871E61D01D128E900047AAFE /* 细说明朝.epub in Resources */,
501497
AB9A96CA1CFC2EE80066030C /* LaunchScreen.storyboard in Resources */,
502498
8726DA4F1D0800A10072323A /* ic_add.png in Resources */,
503499
8726DA4B1D07FF830072323A /* bt_tjcp_no@2x.png in Resources */,
@@ -679,7 +675,7 @@
679675
buildSettings = {
680676
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
681677
CODE_SIGN_IDENTITY = "iPhone Developer";
682-
DEVELOPMENT_TEAM = P348GLNLW8;
678+
DEVELOPMENT_TEAM = WZSZ3VSE2H;
683679
GCC_PREFIX_HEADER = "LSYReader/LSYReader-Prefix.pch";
684680
HEADER_SEARCH_PATHS = " /usr/include/libxml2";
685681
INFOPLIST_FILE = LSYReader/Info.plist;
@@ -696,7 +692,7 @@
696692
buildSettings = {
697693
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
698694
CODE_SIGN_IDENTITY = "iPhone Developer";
699-
DEVELOPMENT_TEAM = P348GLNLW8;
695+
DEVELOPMENT_TEAM = WZSZ3VSE2H;
700696
GCC_PREFIX_HEADER = "LSYReader/LSYReader-Prefix.pch";
701697
HEADER_SEARCH_PATHS = " /usr/include/libxml2";
702698
INFOPLIST_FILE = LSYReader/Info.plist;

LSYReader/LSYReader/Reader/.DS_Store

0 Bytes
Binary file not shown.

LSYReader/LSYReader/Reader/Core/LSYReadParser.m

-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ +(NSAttributedString *)parserEpubImageWithSize:(NSDictionary *)dic config:(LSYRe
108108
CFAttributedStringSetAttribute((CFMutableAttributedStringRef)attrString, CFRangeMake(0, 1), kCTRunDelegateAttributeName, delegate);
109109
CFRelease(delegate);
110110
return [attrString copy];
111-
112-
113111
}
114112
+(NSDictionary *)parserAttribute:(LSYReadConfig *)config
115113
{

LSYReader/LSYReader/Reader/LSYReadPageViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ -(LSYReadViewController *)readViewWithChapter:(NSUInteger)chapter page:(NSUInteg
255255
}
256256
_readView = [[LSYReadViewController alloc] init];
257257
_readView.recordModel = _model.record;
258-
// NSLog(@"---%@",[NSURL fileURLWithPath:_model.chapters[chapter].chapterpath]);
258+
259259
if (_model.type == ReaderEpub) {
260260
_readView.type = ReaderEpub;
261261
if (!_model.chapters[chapter].epubframeRef) {

LSYReader/LSYReader/Reader/LSYReadView.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
@property (nonatomic,assign) CTFrameRef frameRef;
1414
@property (nonatomic,strong) NSString *content;
1515
@property (nonatomic,strong) NSArray *imageArray;
16-
@property (nonatomic,strong) id<LSYReadViewControllerDelegate>delegate;
16+
@property (nonatomic,weak) id<LSYReadViewControllerDelegate>delegate;
1717
-(void)cancelSelected;
1818
@end

LSYReader/LSYReader/Reader/LSYReadView.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ -(void)setFrameRef:(CTFrameRef)frameRef
255255
{
256256
if (_frameRef != frameRef) {
257257
if (_frameRef) {
258-
CFRelease(_frameRef);
258+
// CFRelease(_frameRef);
259259
_frameRef = nil;
260260
}
261261
_frameRef = frameRef;
@@ -264,7 +264,7 @@ -(void)setFrameRef:(CTFrameRef)frameRef
264264
-(void)dealloc
265265
{
266266
if (_frameRef) {
267-
CFRelease(_frameRef);
267+
// CFRelease(_frameRef);
268268
_frameRef = nil;
269269
}
270270
}

LSYReader/LSYReader/Reader/LSYReadViewController.h

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
-(void)readViewEditeding:(LSYReadViewController *)readView;
1616
-(void)readViewEndEdit:(LSYReadViewController *)readView;
1717
@end
18+
1819
@interface LSYReadViewController : UIViewController
1920
@property (nonatomic,strong) NSString *content; //显示的内容
2021
@property (nonatomic,strong) id epubFrameRef; //epub显示内容
Binary file not shown.

LSYReader/LSYReader/Reader/Resource/每天懂一点好玩心理学.epub.REMOVED.git-id

-1
This file was deleted.
Binary file not shown.

LSYReader/LSYReader/ViewController.m

+1-4
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ - (IBAction)begin:(id)sender {
4747
[self presentViewController:pageView animated:YES completion:nil];
4848
});
4949
});
50-
51-
52-
53-
5450
}
51+
5552
- (IBAction)beginEPub:(id)sender {
5653
[_epubActivity startAnimating];
5754
[_beginEpub setTitle:@"" forState:UIControlStateNormal];

0 commit comments

Comments
 (0)