[wing/join-thread] wip
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [wing/join-thread] wip
- Date: Fri, 1 Apr 2022 09:03:56 +0000 (UTC)
commit 0f302c2ff00ad500c4953292af4c12c2ace9e4ee
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Fri Apr 1 11:03:42 2022 +0200
wip
wing/wingservice.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
---
diff --git a/wing/wingservice.c b/wing/wingservice.c
index 15c87b5..a02782e 100644
--- a/wing/wingservice.c
+++ b/wing/wingservice.c
@@ -138,6 +138,26 @@ wing_service_finalize (GObject *object)
G_OBJECT_CLASS (wing_service_parent_class)->finalize (object);
}
+static void
+wing_service_dispose (GObject *object)
+{
+ WingService *service = WING_SERVICE (object);
+ WingServicePrivate *priv;
+
+ priv = wing_service_get_instance_private (service);
+
+ if (priv->thread != NULL)
+ {
+ if (priv->status.dwCurrentState == SERVICE_STOPPED)
+ g_thread_join(priv->thread);
+ else
+ g_warning ("Cannot join the thread if the service is not stopped");
+ priv->thread = NULL;
+ }
+
+ G_OBJECT_CLASS (wing_service_parent_class)->dispose (object);
+}
+
static void
wing_service_get_property (GObject *object,
guint prop_id,
@@ -247,6 +267,7 @@ wing_service_class_init (WingServiceClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = wing_service_finalize;
+ object_class->dispose = wing_service_dispose;
object_class->get_property = wing_service_get_property;
object_class->set_property = wing_service_set_property;
object_class->constructed = wing_service_constructed;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]