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
5d597a36
Commit
5d597a36
authored
Jan 20, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instance: manage StateFile with std::unique_ptr
parent
56eaf000
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
7 deletions
+3
-7
Instance.cxx
src/Instance.cxx
+1
-0
Instance.hxx
src/Instance.hxx
+1
-1
Main.cxx
src/Main.cxx
+1
-6
No files found.
src/Instance.cxx
View file @
5d597a36
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "Instance.hxx"
#include "Instance.hxx"
#include "Partition.hxx"
#include "Partition.hxx"
#include "IdleFlags.hxx"
#include "IdleFlags.hxx"
#include "StateFile.hxx"
#include "Stats.hxx"
#include "Stats.hxx"
#include "client/List.hxx"
#include "client/List.hxx"
#include "input/cache/Manager.hxx"
#include "input/cache/Manager.hxx"
...
...
src/Instance.hxx
View file @
5d597a36
...
@@ -127,7 +127,7 @@ struct Instance final
...
@@ -127,7 +127,7 @@ struct Instance final
std
::
list
<
Partition
>
partitions
;
std
::
list
<
Partition
>
partitions
;
StateFile
*
state_file
=
nullptr
;
std
::
unique_ptr
<
StateFile
>
state_file
;
#ifdef ENABLE_SQLITE
#ifdef ENABLE_SQLITE
std
::
unique_ptr
<
StickerDatabase
>
sticker_database
;
std
::
unique_ptr
<
StickerDatabase
>
sticker_database
;
...
...
src/Main.cxx
View file @
5d597a36
...
@@ -262,7 +262,7 @@ glue_state_file_init(Instance &instance, const ConfigData &raw_config)
...
@@ -262,7 +262,7 @@ glue_state_file_init(Instance &instance, const ConfigData &raw_config)
if
(
!
config
.
IsEnabled
())
if
(
!
config
.
IsEnabled
())
return
;
return
;
instance
.
state_file
=
new
StateFile
(
std
::
move
(
config
),
instance
.
state_file
=
std
::
make_unique
<
StateFile
>
(
std
::
move
(
config
),
instance
.
partitions
.
front
(),
instance
.
partitions
.
front
(),
instance
.
event_loop
);
instance
.
event_loop
);
instance
.
state_file
->
Read
();
instance
.
state_file
->
Read
();
...
@@ -552,11 +552,6 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
...
@@ -552,11 +552,6 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
instance
.
BeginShutdownUpdate
();
instance
.
BeginShutdownUpdate
();
if
(
instance
.
state_file
!=
nullptr
)
{
instance
.
state_file
->
Write
();
delete
instance
.
state_file
;
}
ZeroconfDeinit
();
ZeroconfDeinit
();
instance
.
BeginShutdownPartitions
();
instance
.
BeginShutdownPartitions
();
...
...
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