]> granicus.if.org Git - libevent/commitdiff
Merge remote-tracking branch 'origin/patches-2.0'
authorNick Mathewson <nickm@torproject.org>
Wed, 8 Jun 2011 18:29:36 +0000 (14:29 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 8 Jun 2011 18:29:36 +0000 (14:29 -0400)
1  2 
buffer_iocp.c
event.c
evmap.c

diff --cc buffer_iocp.c
Simple merge
diff --cc event.c
index 62ec7f546044e81a827c4a01152b4ddc1f09091d,27bf3dc32c886a17d021934bde9520cb61a37250..18de9137e5d7b69dabc57154f9ff92c62854a3e9
+++ b/event.c
@@@ -682,15 -681,21 +682,21 @@@ event_base_free(struct event_base *base
        /* XXXX grab the lock? If there is contention when one thread frees
         * the base, then the contending thread will be very sad soon. */
  
+       /* event_base_free(NULL) is how to free the current_base if we
+        * made it with event_init and forgot to hold a reference to it. */
        if (base == NULL && current_base)
                base = current_base;
+       /* If we're freeing current_base, there won't be a current_base. */
        if (base == current_base)
                current_base = NULL;
+       /* Don't actually free NULL. */
+       if (base == NULL) {
+               event_warnx("%s: no base to free", __func__);
+               return;
+       }
        /* XXX(niels) - check for internal events first */
-       EVUTIL_ASSERT(base);
  
 -#ifdef WIN32
 +#ifdef _WIN32
        event_base_stop_iocp(base);
  #endif
  
diff --cc evmap.c
Simple merge