[CoreGraphics] Fix issue with the MakeMutable in CGPath where ref count was leaking. (#3228)
This commit is contained in:
Родитель
f43cb7eefa
Коммит
a52748277d
|
@ -560,7 +560,7 @@ namespace XamCore.CoreGraphics {
|
|||
static CGPath MakeMutable (IntPtr source)
|
||||
{
|
||||
var mutable = CGPathCreateMutableCopy (source);
|
||||
return new CGPath (mutable, false);
|
||||
return new CGPath (mutable, owns: true);
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreGraphicsLibrary)]
|
||||
|
|
|
@ -275,8 +275,9 @@ namespace MonoTouchFixtures.CoreGraphics {
|
|||
using (var copy = p1.Copy ())
|
||||
{
|
||||
var newRetainCount = CFGetRetainCount (copy.Handle);
|
||||
Assert.AreNotEqual (count, newRetainCount, $"Count is {newRetainCount} and was {count}");
|
||||
Assert.IsTrue (count < newRetainCount);
|
||||
Assert.AreEqual (count, newRetainCount, "Ref count should not have changed.");
|
||||
Assert.AreEqual (1, count, "Original count.");
|
||||
Assert.AreEqual (1, newRetainCount, "New count");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче