use g_source_destroy instead of free on serial object
authorKeith Packard <keithp@keithp.com>
Sat, 18 Jul 2009 07:44:01 +0000 (00:44 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 18 Jul 2009 07:44:01 +0000 (00:44 -0700)
aoview/aoview_serial.c

index f5142ea51ad4e8a8a07aac36eca47143bcf08714..29038b79af6ea747af0da5bd222ed33acb5275ea 100644 (file)
@@ -234,7 +234,7 @@ aoview_serial_open(const char *tty)
        aoview_buf_init(&serial->out_buf);
        serial->fd = open (tty, O_RDWR | O_NONBLOCK);
        if (serial->fd < 0) {
        aoview_buf_init(&serial->out_buf);
        serial->fd = open (tty, O_RDWR | O_NONBLOCK);
        if (serial->fd < 0) {
-               free (serial);
+               g_source_destroy(&serial->source);
                return NULL;
        }
        tcgetattr(serial->fd, &termios);
                return NULL;
        }
        tcgetattr(serial->fd, &termios);