Changeset 2770be99


Ignore:
Timestamp:
Jul 16, 2011, 12:31:32 AM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
c855755
Parents:
f6ab6ee
git-author:
David Benjamin <davidben@mit.edu> (07/12/11 23:27:01)
git-committer:
David Benjamin <davidben@mit.edu> (07/16/11 00:31:32)
Message:
Don't remove GPollFDs in a source's finalize

Arguably this was somewhat of a poor move on glib's part, but you trip
over an assert if you remove a poll from a destroyed source. (This is
distinct from an unref; a source gets the destroyed flag when it is
removed from its GMainContext, and it is finalized when it loses all its
references.)

Reported-by: Edward Z. Yang <ezyang@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • aim.c

    r24b2f18 r2770be99  
    18911891{
    18921892  owl_aim_event_source *event_source = (owl_aim_event_source*)source;
    1893   truncate_pollfd_list(event_source, 0);
    1894   g_ptr_array_free(event_source->fds, TRUE);
     1893  /* Don't remove the GPollFDs. We are being finalized, so they'll be removed
     1894   * for us. Moreover, glib will fire asserts if g_source_remove_poll is called
     1895   * on a source which has been destroyed (which occurs when g_source_remove is
     1896   * called on it). */
     1897  owl_ptr_array_free(event_source->fds, g_free);
    18951898}
    18961899
Note: See TracChangeset for help on using the changeset viewer.