Commit 1fdbff7a3ac360de4edcf87f9658105fd1fd4880

Authored by zhangxiaowen
1 parent 441b6f6a

no message

CNLivePlayer/Classes/Database/CNLivePlayerDBTool.m
... ... @@ -68,6 +68,8 @@
68 68 } else {
69 69 NSLog(@"建表成功");
70 70 }
  71 + [db close];
  72 +
71 73 }];
72 74  
73 75 }
... ... @@ -80,6 +82,8 @@
80 82 while ([re next]) {
81 83 isResult = YES;
82 84 }
  85 + [db close];
  86 +
83 87 }];
84 88 return isResult;
85 89  
... ... @@ -94,7 +98,8 @@
94 98 model = [[CNLivePlayerDBModel alloc] initWithContenId:[rs stringForColumn:@"contentId"] url:[rs stringForColumn:@"url"]];
95 99 model.finish = [rs boolForColumn:@"finish"];
96 100 }
97   -
  101 + [db close];
  102 +
98 103 }];
99 104 return model;
100 105  
... ... @@ -113,6 +118,8 @@
113 118 [self openDB:^(int result, FMDatabase *db) {
114 119 NSString * check = [NSString stringWithFormat:@"UPDATE DATATABLE SET finish = 1 where contentId = '%@'",contentId];
115 120 isResult = [db executeUpdate:check];
  121 + [db close];
  122 +
116 123 }];
117 124 return isResult;
118 125  
... ... @@ -130,6 +137,7 @@
130 137 isResult = YES;
131 138 }
132 139 }
  140 + [db close];
133 141  
134 142 }];
135 143 return isResult;
... ... @@ -144,6 +152,7 @@
144 152 if (res) {
145 153 isResult = YES;
146 154 }
  155 + [db close];
147 156  
148 157 }];
149 158 return isResult;
... ... @@ -162,7 +171,8 @@
162 171 model.finish = [rs boolForColumn:@"finish"];
163 172 [list addObject:model];
164 173 }
165   -
  174 + [db close];
  175 +
166 176 }];
167 177 return list;
168 178 }
... ... @@ -181,7 +191,8 @@
181 191 if (res) {
182 192 isResult = YES;
183 193 }
184   -
  194 + [db close];
  195 +
185 196 }];
186 197 return isResult;
187 198  
... ...
CNLivePlayer/Classes/Download/CNLiveHTTPProxyService.m
... ... @@ -89,6 +89,7 @@
89 89  
90 90 - (void)deleteAllCachesWithError:(NSError *__autoreleasing *)error {
91 91 [[KSYHTTPProxyService sharedInstance] deleteAllCachesWithError:error];
  92 + //清空数据缓存
92 93 [[CNLivePlayerDBTool shared] clearTable];
93 94 }
94 95  
... ...
CNLivePlayer/Classes/Player/CNLivePlayer.m
... ... @@ -47,7 +47,6 @@
47 47 @end
48 48  
49 49 @implementation CNLivePlayer
50   -#pragma mark - 通知
51 50 //收到消息通知
52 51 NSString * const CNLivePlayerMsgReceiveNotification = @"CNLiveMsgToolsPlayerReceiveNotification";
53 52 //获取主播状态通知
... ...
Example/CNLivePlayer/CNLiveAppDelegate.m
... ... @@ -18,7 +18,7 @@
18 18 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
19 19 {
20 20 // Override point for customization after application launch.
21   - [CNLivePlayerManager setAppId:CNLivePlayer_AppId appKey:CNLivePlayer_AppKey isTestEnvironment:NO];
  21 + [CNLivePlayerManager setAppId:CNLivePlayer_AppId appKey:CNLivePlayer_AppKey isTestEnvironment:YES];
22 22  
23 23 return YES;
24 24 }
... ...