core: make the properties on wp_core_new to be (transfer full)
This aligns better with the general design of consuming property objects on constructors, both in PipeWire and WirePlumber APIs
This commit is contained in:
@@ -339,7 +339,7 @@ wp_core_class_init (WpCoreClass * klass)
|
|||||||
/**
|
/**
|
||||||
* wp_core_new:
|
* wp_core_new:
|
||||||
* @context: (transfer none) (nullable): the #GMainContext to use for events
|
* @context: (transfer none) (nullable): the #GMainContext to use for events
|
||||||
* @properties: (transfer none) (nullable): additional properties, which are
|
* @properties: (transfer full) (nullable): additional properties, which are
|
||||||
* passed to `pw_context_new` and `pw_context_connect`
|
* passed to `pw_context_new` and `pw_context_connect`
|
||||||
*
|
*
|
||||||
* Returns: (transfer full): a new #WpCore
|
* Returns: (transfer full): a new #WpCore
|
||||||
@@ -347,6 +347,7 @@ wp_core_class_init (WpCoreClass * klass)
|
|||||||
WpCore *
|
WpCore *
|
||||||
wp_core_new (GMainContext *context, WpProperties * properties)
|
wp_core_new (GMainContext *context, WpProperties * properties)
|
||||||
{
|
{
|
||||||
|
g_autoptr (WpProperties) props = properties;
|
||||||
return g_object_new (WP_TYPE_CORE,
|
return g_object_new (WP_TYPE_CORE,
|
||||||
"context", context,
|
"context", context,
|
||||||
"properties", properties,
|
"properties", properties,
|
||||||
|
@@ -77,7 +77,7 @@ wp_base_test_fixture_setup (WpBaseTestFixture * self, WpBaseTestFlags flags)
|
|||||||
|
|
||||||
/* init our core */
|
/* init our core */
|
||||||
props = wp_properties_new (PW_KEY_REMOTE_NAME, self->server.name, NULL);
|
props = wp_properties_new (PW_KEY_REMOTE_NAME, self->server.name, NULL);
|
||||||
self->core = wp_core_new (self->context, props);
|
self->core = wp_core_new (self->context, wp_properties_ref (props));
|
||||||
g_signal_connect (self->core, "disconnected",
|
g_signal_connect (self->core, "disconnected",
|
||||||
(GCallback) disconnected_callback, self);
|
(GCallback) disconnected_callback, self);
|
||||||
|
|
||||||
@@ -86,7 +86,7 @@ wp_base_test_fixture_setup (WpBaseTestFixture * self, WpBaseTestFlags flags)
|
|||||||
|
|
||||||
/* init the second client's core */
|
/* init the second client's core */
|
||||||
if (flags & WP_BASE_TEST_FLAG_CLIENT_CORE) {
|
if (flags & WP_BASE_TEST_FLAG_CLIENT_CORE) {
|
||||||
self->client_core = wp_core_new (self->context, props);
|
self->client_core = wp_core_new (self->context, wp_properties_ref (props));
|
||||||
g_signal_connect (self->client_core, "disconnected",
|
g_signal_connect (self->client_core, "disconnected",
|
||||||
(GCallback) disconnected_callback, self);
|
(GCallback) disconnected_callback, self);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user