[Webkit-unassigned] [Bug 138961] crash in CAAnimation dealloc (CA::release_objects X::List)
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Sep 18 01:43:23 PDT 2015
https://bugs.webkit.org/show_bug.cgi?id=138961
chenwenhong <wenpkpk at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wenpkpk at gmail.com
--- Comment #9 from chenwenhong <wenpkpk at gmail.com> ---
Hi, friends.
This bug occurred since ios8. Today i fixed this bug.
@interface H5WebKitBugsManager : NSObject
+ (void)fixAllBugs;
@end
#import "H5WebKitBugsManager.h"
#import <objc/runtime.h>
void H5Swizzle(Class c, SEL orig, SEL new)
{
Method origMethod = class_getInstanceMethod(c, orig);
Method newMethod = class_getInstanceMethod(c, new);
if(class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
} else {
method_exchangeImplementations(origMethod, newMethod);
}
}
@implementation H5WebKitBugsManager
+ (void)fixAllBugs
{
[self fixBug_MediaPlayerVolumeView];
}
+ (void)fixBug_MediaPlayerVolumeView
{
CGFloat systemVersion = [UIDevice currentDevice].systemVersion.floatValue;
if (systemVersion < 8.0f || systemVersion > 9.0) {
// 8.0以䏿²¡æVolumeViewï¼9.0å°æªæµè¯æ¯å¦ç±æ¤é®é¢ï¼æ¡ä»¶å¾
ä¿®æ¹
return;
}
Class cls = NSClassFromString(@"WebMediaSessionHelper");
NSString *allocateVolumeView = @"allocateVolumeView";
SEL orig = NSSelectorFromString(allocateVolumeView);
SEL new = @selector(H5WKBMAllocateVolumeView);
Method newMethod = class_getInstanceMethod(self, new);
if(class_addMethod(cls, new, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
H5Swizzle(cls, orig, new);
}
}
- (void)H5WKBMAllocateVolumeView
{
// WebKit's MediaSessionManageriOS is a singletonï¼in MediaSessionManageriOS.m. svn version181,859.
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // must be dispatch in background thread
[self H5WKBMAllocateVolumeView];
});
});
}
@end
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150918/1bebe5f3/attachment.html>
More information about the webkit-unassigned
mailing list