Skip to content

Instantly share code, notes, and snippets.

@rolfbjarne
Created October 8, 2015 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolfbjarne/ea5787a972e2d50c896d to your computer and use it in GitHub Desktop.
Save rolfbjarne/ea5787a972e2d50c896d to your computer and use it in GitHub Desktop.
commit ad616e60611e910412c653b354bc3f2db6038332
Author: Rolf Bjarne Kvinge <rolf@xamarin.com>
Date: Thu Oct 8 11:31:37 2015 +0200
Work around Xamarin bug #34633.
diff --git a/iOS/Image.cs b/iOS/Image.cs
index eecdd93..453a43c 100644
--- a/iOS/Image.cs
+++ b/iOS/Image.cs
@@ -1,4 +1,5 @@
using System;
+using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using CoreGraphics;
using Foundation;
@@ -9,6 +10,8 @@ namespace CGImageBug
[Serializable]
public class Image: BaseImage<CGImage>
{
+ static ConditionalWeakTable<CGImage, CGDataProvider> table = new ConditionalWeakTable<CGImage, CGDataProvider> ();
+
public Image ()
{
}
@@ -70,6 +73,7 @@ namespace CGImageBug
if (img == null) {
throw new FormatException ();
}
+ table.Add (img, dataProvider);
return img;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment