Skip to content

Commit

Permalink
Fix many leaks and stupid bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
typcn committed Aug 1, 2016
1 parent bef6b6b commit 8e51eb5
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions AirPlay/reverseHTTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ bool PTTH::conn(const char *address)
}

printf("[PTTH] %s Connected\n",addr_port);
free(addr_chr);
return true;
}

Expand Down
3 changes: 1 addition & 2 deletions bilibili/Browser/Browser.mm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ -(CTTabContents*)createTabBasedOn:(CTTabContents*)baseContents withUrl:(NSString
}

-(CTTabContents*)createTabBasedOn:(CTTabContents*)baseContents withRequest:(NSURLRequest*) req andConfig:(id)cfg{
NSMutableURLRequest *re = [[NSMutableURLRequest alloc] init];
re = (NSMutableURLRequest *) req.mutableCopy;
NSMutableURLRequest *re = (NSMutableURLRequest *) req.mutableCopy;
NSUserDefaults *settingsController = [NSUserDefaults standardUserDefaults];
NSString *xff = [settingsController objectForKey:@"xff"];
if([xff length] > 4){
Expand Down
5 changes: 3 additions & 2 deletions bilibili/Browser/TWebView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ - (void)dealloc{
}

- (TWebView *)initWithRequest:(NSURLRequest *)req andConfig:(id)cfg setDelegate:(id <TWebViewDelegate>)aDelegate{
self = [super init];

if (self.delegate != aDelegate) {
self.delegate = aDelegate;
settingsController = [NSUserDefaults standardUserDefaults];
Expand Down Expand Up @@ -198,8 +200,7 @@ - (NSURLRequest *)webView:(WebView *)sender
redirectResponse:(NSURLResponse *)redirectResponse
fromDataSource:(WebDataSource *)dataSource{
NSString *URL = [request.URL absoluteString];
NSMutableURLRequest *re = [[NSMutableURLRequest alloc] init];
re = (NSMutableURLRequest *) request.mutableCopy;
NSMutableURLRequest *re = (NSMutableURLRequest *) request.mutableCopy;
if([URL containsString:@"googlesyndication"] || [URL containsString:@"analytics.js"]){
// Google ad is blocked in some (china) area, maybe take 30 seconds to wait for timeout
[re setURL:[NSURL URLWithString:@"http://static.hdslb.com/images/transparent.gif"]];
Expand Down
1 change: 1 addition & 0 deletions bilibili/Browser/WebTabView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ -(id)initWithBaseTabContents:(CTTabContents*)baseContents {
}

-(id)initWithRequest:(NSURLRequest *)req andConfig:(id)cfg{
self = [super init];
webView = [[TWebView alloc] initWithRequest:req andConfig:cfg setDelegate:self];
[self loadStartupScripts];
[self setIsWaitingForResponse:YES];
Expand Down
2 changes: 1 addition & 1 deletion bilibili/CommentConvert
2 changes: 1 addition & 1 deletion bilibili/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3079</string>
<string>3083</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
3 changes: 2 additions & 1 deletion bilibili/Player/PlayerView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ - (void) loadMPVSettings{

- (NSDictionary *) getVideoInfo:(NSString *)url{
NSLog(@"[VideoReader] Video Address: %@",url);
BOOL trySimpleParser;
BOOL trySimpleParser = NO;
if([url containsString:@".flv"] ||
[url containsString:@"acgvideo.com"] ||
[url containsString:@"v.iask.com"] ||
Expand All @@ -396,6 +396,7 @@ - (NSDictionary *) getVideoInfo:(NSString *)url{
@"width": width,
@"height": height,
};
delete &MI;
return info;
}

Expand Down
1 change: 0 additions & 1 deletion bilibili/Player/PlayerWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ - (void)mouseDragged:(NSEvent *)theEvent {

CGPoint newOrigin;

currentLocation = [NSEvent mouseLocation];
newOrigin.x = currentLocation.x - initialLocation.x;
newOrigin.y = currentLocation.y - initialLocation.y;

Expand Down
2 changes: 1 addition & 1 deletion chromium-tabs

0 comments on commit 8e51eb5

Please sign in to comment.