diff --git a/tests/apitest/src/AppKit/NSPasteboard.cs b/tests/apitest/src/AppKit/NSPasteboard.cs index 29014421b9..c36c999889 100644 --- a/tests/apitest/src/AppKit/NSPasteboard.cs +++ b/tests/apitest/src/AppKit/NSPasteboard.cs @@ -14,8 +14,13 @@ namespace Xamarin.Mac.Tests public void NSPasteboardTests_WriteObjectTests () { NSPasteboard b = NSPasteboard.CreateWithUniqueName(); + if (b == null) + Assert.Inconclusive ("NSPasteboard could not be provided by the OS."); b.WriteObjects (new INSPasteboardWriting [] { (NSString)"asfd" }); b.WriteObjects (new NSPasteboardWriting [] { new MyPasteboard () }); + // from the docs: the lifetime of a unique pasteboard is not related to the lifetime of the creating app, + // you must release a unique pasteboard by calling releaseGlobally to avoid possible leaks. + b.ReleaseGlobally (); } class MyPasteboard2 : NSPasteboardReading