[gssdp] Make it possible to call _init multiple times
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gssdp] Make it possible to call _init multiple times
- Date: Fri, 16 Nov 2012 12:25:20 +0000 (UTC)
commit e5ad286800f2489d492f0d80a5c78e44492af62f
Author: Jens Georg <mail jensge org>
Date: Sat Nov 10 19:47:59 2012 +0100
Make it possible to call _init multiple times
libgssdp/gssdp-client.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index c96286d..2415bd6 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -95,6 +95,7 @@ struct _GSSDPClientPrivate {
GSSDPSocketSource *search_socket;
gboolean active;
+ gboolean initialized;
};
enum {
@@ -167,6 +168,10 @@ gssdp_client_initable_init (GInitable *initable,
{
GSSDPClient *client = GSSDP_CLIENT (initable);
GError *internal_error = NULL;
+
+ if (client->priv->initialized)
+ return TRUE;
+
#ifdef G_OS_WIN32
WSADATA wsaData = {0};
if (WSAStartup (MAKEWORD (2,2), &wsaData) != 0) {
@@ -257,6 +262,8 @@ gssdp_client_initable_init (GInitable *initable,
gssdp_socket_source_attach (client->priv->multicast_socket);
gssdp_socket_source_attach (client->priv->search_socket);
+ client->priv->initialized = TRUE;
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]