GoogleAdMobAds.GADInterstitial.Dispose C# (CSharp) Method

Dispose() private method

private Dispose ( bool disposing ) : void
disposing bool
return void
		protected override void Dispose (bool disposing)
		{
			base.Dispose (disposing);
			if (Handle == IntPtr.Zero) {
				__mt_WeakDelegate_var = null;
			}
		}
	} /* class GADInterstitial */

Usage Example

Example #1
0
		void AddToView ()
		{
			if (interstitialRequested)
				return;

			if (adInterstitial == null) {
				adInterstitial = new GADInterstitial (intersitialId);
						
				adInterstitial.ScreenDismissed += (sender, e) => { 
					interstitialRequested = false;

					// You need to explicitly Dispose GADInterstitial when you dont need it anymore
					// to avoid crashes if pending request are in progress
					adInterstitial.Dispose ();
					adInterstitial = null;
				};
			}

			interstitialRequested = true;
			adInterstitial.LoadRequest (GADRequest.Request);

			ShowInterstitial ();
		}