mirror of
				https://github.com/Ryujinx/GtkSharp.git
				synced 2025-11-04 13:04:53 +00:00 
			
		
		
		
	glib: Fix native GLib warnings when disposing SourceProxy objects
When an instance of SourceProxy was finalized, we would try to remove the corresponding source, even if it was already removed. This now causes native GLib to print out warnings because it can't find the source ID. Now Source.Remove only calls g_source_remove if we really had a handler registered for the ID we're removing.
This commit is contained in:
		
							parent
							
								
									f5211acb74
								
							
						
					
					
						commit
						7ea0c4afaf
					
				| 
						 | 
				
			
			@ -152,9 +152,15 @@ namespace GLib {
 | 
			
		|||
 | 
			
		||||
		public static bool Remove (uint tag)
 | 
			
		||||
		{
 | 
			
		||||
			lock (Source.source_handlers)
 | 
			
		||||
				source_handlers.Remove (tag);
 | 
			
		||||
			return g_source_remove (tag);
 | 
			
		||||
			// g_source_remove always returns true, so we follow that
 | 
			
		||||
			bool ret = true;
 | 
			
		||||
 | 
			
		||||
			lock (Source.source_handlers) {
 | 
			
		||||
				if (source_handlers.Remove (tag)) {
 | 
			
		||||
					ret = g_source_remove (tag);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			return ret;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue