+2004-09-17 Wim Taymans <wim@fluendo.com>
+
+ * gst/tcp/gstfdset.c: (gst_fdset_wait):
+ * gst/tcp/gstmultifdsink.c: (gst_multifdsink_close):
+ * gst/tcp/gsttcpserversink.c: (gst_tcpserversink_init_send),
+ (gst_tcpserversink_close):
+ Be a bit more paranoid when freeing memory.
+
2004-09-13 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/qtdemux/qtdemux.c: (gst_qtdemux_add_stream),
case GST_FDSET_MODE_SELECT:
{
struct timeval tv;
- struct timeval *tvptr = NULL;
+ struct timeval *tvptr;
set->testreadfds = set->readfds;
set->testwritefds = set->writefds;
tv.tv_usec = timeout % 1000;
tvptr = &tv;
+ } else {
+ tvptr = NULL;
}
res =
select (FD_SETSIZE, &set->testreadfds, &set->testwritefds,
this->running = FALSE;
SEND_COMMAND (this, CONTROL_STOP);
- g_thread_join (this->thread);
+ if (this->thread) {
+ g_thread_join (this->thread);
+ this->thread = NULL;
+ }
close (READ_SOCKET (this).fd);
close (WRITE_SOCKET (this).fd);
- gst_fdset_remove_fd (this->fdset, &READ_SOCKET (this));
if (this->streamheader) {
- GSList *l;
-
- for (l = this->streamheader; l; l = l->next) {
- gst_buffer_unref (l->data);
- }
+ g_slist_foreach (this->streamheader, (GFunc) gst_data_unref, NULL);
g_slist_free (this->streamheader);
+ this->streamheader = NULL;
}
if (fclass->close)
fclass->close (this);
- gst_fdset_free (this->fdset);
- this->fdset = NULL;
+ if (this->fdset) {
+ gst_fdset_remove_fd (this->fdset, &READ_SOCKET (this));
+ gst_fdset_free (this->fdset);
+ this->fdset = NULL;
+ }
}
static GstElementStateReturn
gst_fdset_add_fd (parent->fdset, &this->server_sock);
gst_fdset_fd_ctl_read (parent->fdset, &this->server_sock, TRUE);
- //FD_SET (this->server_sock_fd, &parent->readfds);
-
return TRUE;
}
GstTCPServerSink *this = GST_TCPSERVERSINK (parent);
if (this->server_sock.fd != -1) {
+ gst_fdset_remove_fd (parent->fdset, &this->server_sock);
+
close (this->server_sock.fd);
this->server_sock.fd = -1;
-
- gst_fdset_remove_fd (parent->fdset, &this->server_sock);
}
return TRUE;
}