diff --git a/iphone/Classes/AppModule.m b/iphone/Classes/AppModule.m index ba49ce5b78c..0d24e2fcc2e 100644 --- a/iphone/Classes/AppModule.m +++ b/iphone/Classes/AppModule.m @@ -237,8 +237,17 @@ -(void)willShutdownContext:(NSNotification*)note { if ([entry context] == context) { - [found addObject:[NSArray - arrayWithObjects:[entry type],[entry listener],nil]]; + id listener = [entry listener]; + if ([listener isKindOfClass:[KrollCallback class]]) + { + [found addObject:[NSArray + arrayWithObjects:((KrollCallback*)listener).type,listener,nil]]; + } + else + { + [found addObject:[NSArray + arrayWithObjects:[entry type],listener,nil]]; + } } } }