Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
df7d7732
Commit
df7d7732
authored
Jul 15, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
state_file: simplified state_file_finish()
Return early from the destructor function when there is no configured state file. Don't check the timer, don't call g_free(NULL).
parent
889b1c1e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
state_file.c
src/state_file.c
+6
-4
No files found.
src/state_file.c
View file @
df7d7732
...
...
@@ -41,8 +41,7 @@ state_file_write(void)
{
FILE
*
fp
;
if
(
state_file_path
==
NULL
)
return
;
assert
(
state_file_path
!=
NULL
);
g_debug
(
"Saving state file %s"
,
state_file_path
);
...
...
@@ -114,11 +113,14 @@ state_file_init(const char *path)
void
state_file_finish
(
void
)
{
if
(
state_file_path
==
NULL
)
/* no state file configured, no cleanup required */
return
;
if
(
save_state_source_id
!=
0
)
g_source_remove
(
save_state_source_id
);
if
(
state_file_path
!=
NULL
)
state_file_write
();
state_file_write
();
g_free
(
state_file_path
);
}
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