Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
49661f4c
Commit
49661f4c
authored
Oct 28, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udev: remove remaining items at exit
parent
0132bb5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
modules/services_discovery/udev.c
modules/services_discovery/udev.c
+6
-3
No files found.
modules/services_discovery/udev.c
View file @
49661f4c
...
...
@@ -63,6 +63,7 @@ struct device
{
dev_t
devnum
;
/* must be first */
input_item_t
*
item
;
services_discovery_t
*
sd
;
};
struct
subsys
...
...
@@ -99,6 +100,8 @@ static void DestroyDevice (void *data)
{
struct
device
*
d
=
data
;
if
(
d
->
sd
)
services_discovery_RemoveItem
(
d
->
sd
,
d
->
item
);
vlc_gc_decref
(
d
->
item
);
free
(
d
);
}
...
...
@@ -132,8 +135,9 @@ static int AddDevice (services_discovery_t *sd, struct udev_device *dev)
vlc_gc_decref
(
item
);
return
-
1
;
}
d
->
item
=
item
;
d
->
devnum
=
udev_device_get_devnum
(
dev
);
d
->
item
=
item
;
d
->
sd
=
NULL
;
struct
device
**
dp
=
tsearch
(
d
,
&
p_sys
->
root
,
cmpdev
);
if
(
dp
==
NULL
)
/* Out-of-memory */
...
...
@@ -143,13 +147,13 @@ static int AddDevice (services_discovery_t *sd, struct udev_device *dev)
}
if
(
*
dp
!=
d
)
/* Overwrite existing device */
{
services_discovery_RemoveItem
(
sd
,
(
*
dp
)
->
item
);
DestroyDevice
(
*
dp
);
*
dp
=
d
;
}
name
=
p_sys
->
subsys
->
get_cat
(
dev
);
services_discovery_AddItem
(
sd
,
item
,
name
?
name
:
"Generic"
);
d
->
sd
=
sd
;
free
(
name
);
return
0
;
}
...
...
@@ -167,7 +171,6 @@ static void RemoveDevice (services_discovery_t *sd, struct udev_device *dev)
return
;
struct
device
*
d
=
*
dp
;
services_discovery_RemoveItem
(
sd
,
d
->
item
);
tdelete
(
d
,
&
p_sys
->
root
,
cmpdev
);
DestroyDevice
(
d
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment