laveux / adwhirl

Automatically exported from code.google.com/p/adwhirl
0 stars 0 forks source link

iAd crash #277

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Leave my app running for a few minutes. 
2.
3.

What is the expected output? What do you see instead?
I see a crash.

What version of the product are you using? On what operating system?
3.0.0.  iPhone 4s (5.0.1)

Please provide any additional information below.
#0  0x3160afbc in objc_msgSend ()
#1  0x00107250 in -[AdWhirlView reportExImpression:netType:] (self=0x49f0c0, 
_cmd=0x1b6181, nid=0x6a8e50, type=AdWhirlAdNetworkTypeIAd) at 
/Users/Chang/Documents/PokerIncome/trunk/../dependencies/AdWhirl/internal/AdWhir
lView.m:519
#2  0x00108228 in -[AdWhirlView adapter:didReceiveAdView:] (self=0x49f0c0, 
_cmd=0x1b52c9, adapter=0x64b210, view=0x64abb0) at 
/Users/Chang/Documents/PokerIncome/trunk/../dependencies/AdWhirl/internal/AdWhir
lView.m:788
#3  0x000fb7ce in -[AdWhirlAdapterIAd bannerViewDidLoadAd:] (self=0x64b210, 
_cmd=0x35adccb6, banner=0x64abb0) at 
/Users/Chang/Documents/PokerIncome/trunk/../dependencies/AdWhirl/adapters/AdWhir
lAdapterIAd.m:119
#4  0x30971c8e in -[ADBannerView serverBannerViewDidLoad:] ()
#5  0x36ea122a in -[NSObject performSelector:withObject:] ()
#6  0x3097b360 in -[ADSession _handleAdSheetMessage:userInfo:] ()
#7  0x3097dab0 in __32-[ADXPCConnection _handleEvent:]_block_invoke_050 ()
#8  0x33753d54 in _dispatch_call_block_and_release ()
#9  0x33755f7a in _dispatch_main_queue_callback_4CF$VARIANT$mp ()
#10 0x36f152dc in __CFRunLoopRun ()
#11 0x36e984dc in CFRunLoopRunSpecific ()
#12 0x36e983a4 in CFRunLoopRunInMode ()
#13 0x3104efcc in GSEventRunModal ()
#14 0x3250a742 in UIApplicationMain ()
#15 0x000afe68 in main (argc=1, argv=0x2fdffb54) at 
/Users/Chang/Documents/PokerIncome/trunk/Classes/main.m:13

Original issue reported on code.google.com by ch...@pokerincome.com on 13 Jan 2012 at 10:15

GoogleCodeExporter commented 8 years ago
Do you see this with v3.1.1 of the AdWhirl sdk?  Also, what is the particular 
error here?

Original comment by wesgood...@google.com on 17 Jan 2012 at 10:32

GoogleCodeExporter commented 8 years ago
I updated to 3.1.1 and still seeing some random crashes at startup.  But I 
can't be sure yet the new crash has the same crash stack.  The code around this 
error still the same as 3.0.  By looking at this stack, my guess is that 
delegate is over released.

- (void)reportExImpression:(NSString *)nid netType:(AdWhirlAdNetworkType)type {
  NSURL *baseURL = nil;
  if ([delegate respondsToSelector:@selector(adWhirlImpMetricURL)]) {  // line 519
    baseURL = [delegate adWhirlImpMetricURL];
  }
  if (baseURL == nil) {
    baseURL = [NSURL URLWithString:kAdWhirlDefaultImpMetricURL];
  }
  [self metricPing:baseURL nid:nid netType:type];
}

Original comment by ch...@pokerincome.com on 22 Feb 2012 at 7:41

GoogleCodeExporter commented 8 years ago
Are you preemptively releasing the AdWhirlView or its delegate?  This bug 
report seems atypical, which makes me suspect an implementation issue on your 
side.

Original comment by wesgood...@google.com on 23 Feb 2012 at 12:56

GoogleCodeExporter commented 8 years ago
I am using a static adwhirl view.  i.e. all my viewcontrollers in my app shared 
a same static adwhirl view.  Is this ok?

I wonder if the following events will generate this error.  How to fix it?

1. view controller request new ad.  It sends request to the server but the 
response isn't back yet.
2. User pops the view controller thus causing delegate deallocate
3. Ad response comes back and the delegate is already deallocated.

Shall I set adView.delegate = nil in ViewWillDisappear to fix this problem?

I have a abstract view controllers which all my viewcontrollers inherits from.

AbstractUIViewController.m:

static AdWhirlView *adView =nil;
- (void) viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    // put the ad on the bottom

        if (adView == nil){
            adView = [[AdWhirlView requestAdWhirlViewWithDelegate:self] retain];  // retain to avoid dealloc problem due to memory pressure
            adView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;
        }
        adView.delegate = self;
        [adView requestFreshAd];
        [self.view addSubview:adView];
        [self adjustAdSize];
 }

Original comment by ch...@pokerincome.com on 2 Sep 2012 at 4:26