mirror of
				https://github.com/Ryujinx/GtkSharp.git
				synced 2025-11-04 13:04:53 +00:00 
			
		
		
		
	Added Object.TryGetObject that gets wrapper only if already surfaced
This commit is contained in:
		
							parent
							
								
									3a044d6faf
								
							
						
					
					
						commit
						d686a4d6aa
					
				| 
						 | 
				
			
			@ -82,6 +82,19 @@ namespace GLib {
 | 
			
		|||
		[DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
 | 
			
		||||
		static extern void g_object_unref (IntPtr raw);
 | 
			
		||||
		
 | 
			
		||||
		public static Object TryGetObject (IntPtr o)
 | 
			
		||||
		{
 | 
			
		||||
			if (o == IntPtr.Zero)
 | 
			
		||||
				return null;
 | 
			
		||||
 | 
			
		||||
			ToggleRef tr = (ToggleRef) Objects[o];
 | 
			
		||||
			if (tr != null) {
 | 
			
		||||
				return tr.Target;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			return null;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public static Object GetObject(IntPtr o, bool owned_ref)
 | 
			
		||||
		{
 | 
			
		||||
			if (o == IntPtr.Zero)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue