Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wireplumber
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pkg
wireplumber
Commits
0b3433d7
Commit
0b3433d7
authored
5 years ago
by
George Kiagiadakis
Browse files
Options
Downloads
Patches
Plain Diff
modules: fix some ref counting and memory {de-,}allocation issues
parent
ab73fd6e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/module-pipewire.c
+7
-20
7 additions, 20 deletions
modules/module-pipewire.c
modules/module-pw-alsa-udev.c
+7
-20
7 additions, 20 deletions
modules/module-pw-alsa-udev.c
modules/module-pw-audio-softdsp-endpoint.c
+5
-11
5 additions, 11 deletions
modules/module-pw-audio-softdsp-endpoint.c
with
19 additions
and
51 deletions
modules/module-pipewire.c
+
7
−
20
View file @
0b3433d7
...
@@ -55,16 +55,10 @@ endpoint_info_destroy(gpointer p)
...
@@ -55,16 +55,10 @@ endpoint_info_destroy(gpointer p)
struct
endpoint_info
*
ei
=
p
;
struct
endpoint_info
*
ei
=
p
;
/* Free the name */
/* Free the name */
if
(
ei
->
name
)
{
g_free
(
ei
->
name
);
g_free
(
ei
->
name
);
ei
->
name
=
NULL
;
}
/* Free the media class */
/* Free the media class */
if
(
ei
->
media_class
)
{
g_free
(
ei
->
media_class
);
g_free
(
ei
->
media_class
);
ei
->
media_class
=
NULL
;
}
/* Clean up */
/* Clean up */
g_slice_free
(
struct
endpoint_info
,
p
);
g_slice_free
(
struct
endpoint_info
,
p
);
...
@@ -76,10 +70,7 @@ proxy_info_destroy(gpointer p)
...
@@ -76,10 +70,7 @@ proxy_info_destroy(gpointer p)
struct
proxy_info
*
pi
=
p
;
struct
proxy_info
*
pi
=
p
;
/* Unref the proxy port */
/* Unref the proxy port */
if
(
pi
->
proxy_port
)
{
g_clear_object
(
&
pi
->
proxy_port
);
g_object_unref
(
pi
->
proxy_port
);
pi
->
proxy_port
=
NULL
;
}
/* Clean up */
/* Clean up */
g_slice_free
(
struct
proxy_info
,
p
);
g_slice_free
(
struct
proxy_info
,
p
);
...
@@ -122,8 +113,7 @@ proxy_node_created(GObject *initable, GAsyncResult *res, gpointer d)
...
@@ -122,8 +113,7 @@ proxy_node_created(GObject *initable, GAsyncResult *res, gpointer d)
g_variant_builder_add
(
&
b
,
"{sv}"
,
g_variant_builder_add
(
&
b
,
"{sv}"
,
"proxy-node"
,
g_variant_new_uint64
((
guint64
)
proxy_node
));
"proxy-node"
,
g_variant_new_uint64
((
guint64
)
proxy_node
));
g_variant_builder_add
(
&
b
,
"{sv}"
,
g_variant_builder_add
(
&
b
,
"{sv}"
,
"proxy-port"
,
g_variant_new_uint64
((
guint64
)
"proxy-port"
,
g_variant_new_uint64
((
guint64
)
pi
->
proxy_port
));
g_object_ref
(
pi
->
proxy_port
)));
endpoint_props
=
g_variant_builder_end
(
&
b
);
endpoint_props
=
g_variant_builder_end
(
&
b
);
/* Create the endpoint */
/* Create the endpoint */
...
@@ -223,7 +213,7 @@ handle_node (struct module_data *data, uint32_t id, uint32_t parent_id,
...
@@ -223,7 +213,7 @@ handle_node (struct module_data *data, uint32_t id, uint32_t parent_id,
SPA_PARAM_Profile
,
0
,
param
);
SPA_PARAM_Profile
,
0
,
param
);
/* Create the endpoint info */
/* Create the endpoint info */
ei
=
g_new0
(
struct
endpoint_info
,
1
);
ei
=
g_
slice_
new0
(
struct
endpoint_info
);
ei
->
name
=
g_strdup
(
name
);
ei
->
name
=
g_strdup
(
name
);
ei
->
media_class
=
g_strdup
(
media_class
);
ei
->
media_class
=
g_strdup
(
media_class
);
ei
->
proxy
=
proxy
;
ei
->
proxy
=
proxy
;
...
@@ -252,7 +242,7 @@ handle_port(struct module_data *data, uint32_t id, uint32_t parent_id,
...
@@ -252,7 +242,7 @@ handle_port(struct module_data *data, uint32_t id, uint32_t parent_id,
return
;
return
;
/* Create the port info */
/* Create the port info */
pi
=
g_new0
(
struct
proxy_info
,
1
);
pi
=
g_
slice_
new0
(
struct
proxy_info
);
pi
->
data
=
data
;
pi
->
data
=
data
;
pi
->
node_id
=
parent_id
;
pi
->
node_id
=
parent_id
;
pi
->
proxy_port
=
NULL
;
pi
->
proxy_port
=
NULL
;
...
@@ -309,10 +299,7 @@ module_destroy (gpointer d)
...
@@ -309,10 +299,7 @@ module_destroy (gpointer d)
struct
module_data
*
data
=
d
;
struct
module_data
*
data
=
d
;
/* Destroy the hash table */
/* Destroy the hash table */
if
(
data
->
client_nodes_info
)
{
g_hash_table_unref
(
data
->
client_nodes_info
);
g_hash_table_destroy
(
data
->
client_nodes_info
);
data
->
client_nodes_info
=
NULL
;
}
/* Clean up */
/* Clean up */
g_slice_free
(
struct
module_data
,
data
);
g_slice_free
(
struct
module_data
,
data
);
...
...
This diff is collapsed.
Click to expand it.
modules/module-pw-alsa-udev.c
+
7
−
20
View file @
0b3433d7
...
@@ -49,16 +49,10 @@ endpoint_info_destroy(gpointer p)
...
@@ -49,16 +49,10 @@ endpoint_info_destroy(gpointer p)
struct
endpoint_info
*
ei
=
p
;
struct
endpoint_info
*
ei
=
p
;
/* Free the name */
/* Free the name */
if
(
ei
->
name
)
{
g_free
(
ei
->
name
);
g_free
(
ei
->
name
);
ei
->
name
=
NULL
;
}
/* Free the media class */
/* Free the media class */
if
(
ei
->
media_class
)
{
g_free
(
ei
->
media_class
);
g_free
(
ei
->
media_class
);
ei
->
media_class
=
NULL
;
}
/* Clean up */
/* Clean up */
g_slice_free
(
struct
endpoint_info
,
p
);
g_slice_free
(
struct
endpoint_info
,
p
);
...
@@ -70,10 +64,7 @@ proxy_info_destroy(gpointer p)
...
@@ -70,10 +64,7 @@ proxy_info_destroy(gpointer p)
struct
proxy_info
*
pi
=
p
;
struct
proxy_info
*
pi
=
p
;
/* Unref the proxy port */
/* Unref the proxy port */
if
(
pi
->
proxy_port
)
{
g_clear_object
(
&
pi
->
proxy_port
);
g_object_unref
(
pi
->
proxy_port
);
pi
->
proxy_port
=
NULL
;
}
/* Clean up */
/* Clean up */
g_slice_free
(
struct
proxy_info
,
p
);
g_slice_free
(
struct
proxy_info
,
p
);
...
@@ -113,8 +104,7 @@ proxy_node_created(GObject *initable, GAsyncResult *res, gpointer data)
...
@@ -113,8 +104,7 @@ proxy_node_created(GObject *initable, GAsyncResult *res, gpointer data)
g_variant_builder_add
(
&
b
,
"{sv}"
,
g_variant_builder_add
(
&
b
,
"{sv}"
,
"proxy-node"
,
g_variant_new_uint64
((
guint64
)
proxy_node
));
"proxy-node"
,
g_variant_new_uint64
((
guint64
)
proxy_node
));
g_variant_builder_add
(
&
b
,
"{sv}"
,
g_variant_builder_add
(
&
b
,
"{sv}"
,
"proxy-port"
,
g_variant_new_uint64
((
guint64
)
"proxy-port"
,
g_variant_new_uint64
((
guint64
)
pi
->
proxy_port
));
g_object_ref
(
pi
->
proxy_port
)));
endpoint_props
=
g_variant_builder_end
(
&
b
);
endpoint_props
=
g_variant_builder_end
(
&
b
);
/* Create and register the endpoint */
/* Create and register the endpoint */
...
@@ -181,7 +171,7 @@ handle_node(struct impl *impl, uint32_t id, uint32_t parent_id,
...
@@ -181,7 +171,7 @@ handle_node(struct impl *impl, uint32_t id, uint32_t parent_id,
return
;
return
;
/* Create the endpoint info */
/* Create the endpoint info */
ei
=
g_new0
(
struct
endpoint_info
,
1
);
ei
=
g_
slice_
new0
(
struct
endpoint_info
);
ei
->
name
=
g_strdup
(
name
);
ei
->
name
=
g_strdup
(
name
);
ei
->
media_class
=
g_strdup
(
media_class
);
ei
->
media_class
=
g_strdup
(
media_class
);
...
@@ -211,7 +201,7 @@ handle_port(struct impl *impl, uint32_t id, uint32_t parent_id,
...
@@ -211,7 +201,7 @@ handle_port(struct impl *impl, uint32_t id, uint32_t parent_id,
return
;
return
;
/* Create the port info */
/* Create the port info */
pi
=
g_new0
(
struct
proxy_info
,
1
);
pi
=
g_
slice_
new0
(
struct
proxy_info
);
pi
->
impl
=
impl
;
pi
->
impl
=
impl
;
pi
->
node_id
=
parent_id
;
pi
->
node_id
=
parent_id
;
pi
->
proxy_port
=
NULL
;
pi
->
proxy_port
=
NULL
;
...
@@ -267,10 +257,7 @@ module_destroy (gpointer data)
...
@@ -267,10 +257,7 @@ module_destroy (gpointer data)
struct
impl
*
impl
=
data
;
struct
impl
*
impl
=
data
;
/* Destroy the hash table */
/* Destroy the hash table */
if
(
impl
->
alsa_nodes_info
)
{
g_hash_table_unref
(
impl
->
alsa_nodes_info
);
g_hash_table_destroy
(
impl
->
alsa_nodes_info
);
impl
->
alsa_nodes_info
=
NULL
;
}
/* Clean up */
/* Clean up */
g_slice_free
(
struct
impl
,
impl
);
g_slice_free
(
struct
impl
,
impl
);
...
...
This diff is collapsed.
Click to expand it.
modules/module-pw-audio-softdsp-endpoint.c
+
5
−
11
View file @
0b3433d7
...
@@ -340,16 +340,10 @@ endpoint_finalize (GObject * object)
...
@@ -340,16 +340,10 @@ endpoint_finalize (GObject * object)
WpPwAudioSoftdspEndpoint
*
self
=
WP_PW_AUDIO_SOFTDSP_ENDPOINT
(
object
);
WpPwAudioSoftdspEndpoint
*
self
=
WP_PW_AUDIO_SOFTDSP_ENDPOINT
(
object
);
/* Unref the proxy node */
/* Unref the proxy node */
if
(
self
->
proxy_node
)
{
g_clear_object
(
&
self
->
proxy_node
);
g_object_unref
(
self
->
proxy_node
);
self
->
proxy_node
=
NULL
;
}
/* Unref the proxy port */
/* Unref the proxy port */
if
(
self
->
proxy_port
)
{
g_clear_object
(
&
self
->
proxy_port
);
g_object_unref
(
self
->
proxy_port
);
self
->
proxy_port
=
NULL
;
}
/* Clear the dsp info */
/* Clear the dsp info */
if
(
self
->
dsp_info
)
{
if
(
self
->
dsp_info
)
{
...
@@ -376,11 +370,11 @@ endpoint_set_property (GObject * object, guint property_id,
...
@@ -376,11 +370,11 @@ endpoint_set_property (GObject * object, guint property_id,
switch
(
property_id
)
{
switch
(
property_id
)
{
case
PROP_NODE_PROXY
:
case
PROP_NODE_PROXY
:
g_clear_object
(
&
self
->
proxy_node
);
g_clear_object
(
&
self
->
proxy_node
);
self
->
proxy_node
=
g_value_
get
_object
(
value
);
self
->
proxy_node
=
g_value_
dup
_object
(
value
);
break
;
break
;
case
PROP_PORT_PROXY
:
case
PROP_PORT_PROXY
:
g_clear_object
(
&
self
->
proxy_port
);
g_clear_object
(
&
self
->
proxy_port
);
self
->
proxy_port
=
g_value_
get
_object
(
value
);
self
->
proxy_port
=
g_value_
dup
_object
(
value
);
break
;
break
;
default:
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
property_id
,
pspec
);
G_OBJECT_WARN_INVALID_PROPERTY_ID
(
object
,
property_id
,
pspec
);
...
@@ -572,7 +566,7 @@ static const struct pw_registry_proxy_events registry_events = {
...
@@ -572,7 +566,7 @@ static const struct pw_registry_proxy_events registry_events = {
static
gpointer
static
gpointer
endpoint_factory
(
WpFactory
*
factory
,
GType
type
,
GVariant
*
properties
)
endpoint_factory
(
WpFactory
*
factory
,
GType
type
,
GVariant
*
properties
)
{
{
WpCore
*
wp_core
=
NULL
;
g_autoptr
(
WpCore
)
wp_core
=
NULL
;
WpRemote
*
remote
;
WpRemote
*
remote
;
struct
pw_remote
*
pw_remote
;
struct
pw_remote
*
pw_remote
;
const
gchar
*
name
=
NULL
;
const
gchar
*
name
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment