-
-
Save rolfbjarne/ea5787a972e2d50c896d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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