* ensure the event loop is finished before freeing the poll object
* set Client.Handle to null immediately after freeing it
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1216
941a03a8-eaeb-0310-b9a0-
b1bbd8fe43fe
throw new ClientException (error);
thread = new Thread (PollLoop);
+ thread.IsBackground = true;
thread.Start ();
}
if (handle != IntPtr.Zero) {
lock (this) {
avahi_client_free (handle);
+ handle = IntPtr.Zero;
+
avahi_simple_poll_quit (spoll);
+ Monitor.Wait (this);
+
avahi_simple_poll_free (spoll);
- handle = IntPtr.Zero;
}
}
}
try {
lock (this) {
avahi_simple_poll_loop (spoll);
+ Monitor.Pulse (this);
}
} catch (Exception e) {
Console.Error.WriteLine ("Error in avahi-sharp event loop: " + e);