summaryrefslogtreecommitdiffstats
path: root/avahi-sharp/Client.cs
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-sharp/Client.cs')
-rw-r--r--avahi-sharp/Client.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/avahi-sharp/Client.cs b/avahi-sharp/Client.cs
index 6d39469..40ca411 100644
--- a/avahi-sharp/Client.cs
+++ b/avahi-sharp/Client.cs
@@ -271,7 +271,6 @@ namespace Avahi
throw new ClientException (error);
thread = new Thread (PollLoop);
- thread.IsBackground = true;
thread.Start ();
}
@@ -286,10 +285,12 @@ namespace Avahi
public void Dispose ()
{
if (handle != IntPtr.Zero) {
- avahi_client_free (handle);
- avahi_simple_poll_quit (spoll);
- avahi_simple_poll_free (spoll);
- handle = IntPtr.Zero;
+ lock (this) {
+ avahi_client_free (handle);
+ avahi_simple_poll_quit (spoll);
+ avahi_simple_poll_free (spoll);
+ handle = IntPtr.Zero;
+ }
}
}