]> git.meshlink.io Git - catta/blobdiff - avahi-sharp/ServiceTypeBrowser.cs
s/Host/HostName/ in a couple places, and keep references to callbacks to
[catta] / avahi-sharp / ServiceTypeBrowser.cs
index c3b8159dcfd5b930092f57385b6418db38e8dea2..e436da9a834555e341b5a1546cd5b26db22692c5 100644 (file)
@@ -46,6 +46,7 @@ namespace Avahi
         private int iface;
         private Protocol proto;
         private string domain;
+        private ServiceTypeBrowserCallback cb;
 
         private ArrayList addListeners = new ArrayList ();
         private ArrayList removeListeners = new ArrayList ();
@@ -101,6 +102,7 @@ namespace Avahi
             this.iface = iface;
             this.proto = proto;
             this.domain = domain;
+            cb = OnServiceTypeBrowserCallback;
         }
 
         ~ServiceTypeBrowser ()
@@ -120,7 +122,7 @@ namespace Avahi
 
             IntPtr domainPtr = Utility.StringToPtr (domain);
             handle = avahi_service_type_browser_new (client.Handle, iface, (int) proto, domainPtr,
-                                                     OnServiceTypeBrowserCallback, IntPtr.Zero);
+                                                     cb, IntPtr.Zero);
             Utility.Free (domainPtr);
         }