mono / xwt

A cross-platform UI toolkit for creating desktop applications with .NET and Mono
MIT License
1.37k stars 241 forks source link

Keep a local ref of the NSImage so it doesn't try to get reconstructed #1118

Closed marshall-lerner closed 1 year ago

marshall-lerner commented 1 year ago

VSMac is getting some exceptions that we are trying to resurrect the image in this code, so keep a local copy of the NSImage...

Here is the part of the exception callstack:

"ObjCRuntime.Runtime.MissingCtor(IntPtr,IntPtr,Type,MissingCtorResolution)", "ObjCRuntime.Runtime.ConstructNSObject[T](IntPtr,Type,MissingCtorResolution)", "ObjCRuntime.Runtime.GetNSObject[T](IntPtr)", "AppKit.NSImageView.get_Image()", "Xwt.Mac.ImageViewBackend.SetImage(ImageDescription)", "Xwt.ImageView.set_Image(Image)",