Skip to content

Commit 53fa9ec

Browse files
committed
Allow replacing channel managers in wocky-connector
This is required to allow gabble-connection to replace connection= bound managers in existing connector if resume fails and we want to continue reusing the connector for future resumptions.
1 parent 3434996 commit 53fa9ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

wocky/wocky-connector.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,13 @@ wocky_connector_set_property (GObject *object,
494494
priv->session_id = g_value_dup_string (value);
495495
break;
496496
case PROP_AUTH_REGISTRY:
497+
if (priv->auth_registry != NULL)
498+
g_object_unref (priv->auth_registry);
497499
priv->auth_registry = g_value_dup_object (value);
498500
break;
499501
case PROP_TLS_HANDLER:
502+
if (priv->tls_handler != NULL)
503+
g_object_unref (priv->tls_handler);
500504
priv->tls_handler = g_value_dup_object (value);
501505
break;
502506
default:
@@ -747,7 +751,7 @@ wocky_connector_class_init (WockyConnectorClass *klass)
747751
*/
748752
spec = g_param_spec_object ("auth-registry", "Authentication Registry",
749753
"Authentication Registry", WOCKY_TYPE_AUTH_REGISTRY,
750-
(G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
754+
(G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
751755
g_object_class_install_property (oclass, PROP_AUTH_REGISTRY, spec);
752756

753757
/**
@@ -758,7 +762,7 @@ wocky_connector_class_init (WockyConnectorClass *klass)
758762
*/
759763
spec = g_param_spec_object ("tls-handler", "TLS Handler",
760764
"TLS Handler", WOCKY_TYPE_TLS_HANDLER,
761-
(G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
765+
(G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
762766
g_object_class_install_property (oclass, PROP_TLS_HANDLER, spec);
763767

764768
/**

0 commit comments

Comments
 (0)