mirror of
				https://github.com/Ryujinx/GtkSharp.git
				synced 2025-11-04 13:04:53 +00:00 
			
		
		
		
	Value: First try to invoke a constructor with IntPtr, bool
In Cairo there the default constructor does not take a ref to the native object making the object invalid when trying to access it. This commit changes the behaviour to search for another constructor that takes an owner variable which is set to false when invoked to indicate that the managed side should take a ref.
This commit is contained in:
		
							parent
							
								
									7ea0c4afaf
								
							
						
					
					
						commit
						1fab57eeac
					
				| 
						 | 
				
			
			@ -437,7 +437,11 @@ namespace GLib {
 | 
			
		|||
			if (mi != null)
 | 
			
		||||
				return mi.Invoke (null, new object[] {boxed_ptr});
 | 
			
		||||
 | 
			
		||||
			ConstructorInfo ci = t.GetConstructor (new Type[] { typeof(IntPtr) });
 | 
			
		||||
			ConstructorInfo ci = t.GetConstructor (new Type[] { typeof(IntPtr), typeof (bool) });
 | 
			
		||||
			if (ci != null)
 | 
			
		||||
				return ci.Invoke (new object[] { boxed_ptr, false });
 | 
			
		||||
 | 
			
		||||
			ci = t.GetConstructor (new Type[] { typeof(IntPtr) });
 | 
			
		||||
			if (ci != null)
 | 
			
		||||
				return ci.Invoke (new object[] { boxed_ptr });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue