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
71a5c8b8
Commit
71a5c8b8
authored
May 29, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Main: allocate Instance on the stack
parent
620a39af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
89 additions
and
86 deletions
+89
-86
Idle.cxx
src/Idle.cxx
+1
-1
Main.cxx
src/Main.cxx
+81
-78
Main.hxx
src/Main.hxx
+1
-1
Mapper.cxx
src/Mapper.cxx
+4
-4
Win32Main.cxx
src/win32/Win32Main.cxx
+2
-2
No files found.
src/Idle.cxx
View file @
71a5c8b8
...
...
@@ -33,5 +33,5 @@ idle_add(unsigned flags)
{
assert
(
flags
!=
0
);
instance
->
EmitIdle
(
flags
);
global_
instance
->
EmitIdle
(
flags
);
}
src/Main.cxx
View file @
71a5c8b8
This diff is collapsed.
Click to expand it.
src/Main.hxx
View file @
71a5c8b8
...
...
@@ -31,7 +31,7 @@ extern Context *context;
extern
LogListener
*
logListener
;
#endif
extern
Instance
*
instance
;
extern
Instance
*
global_
instance
;
#ifndef ANDROID
...
...
src/Mapper.cxx
View file @
71a5c8b8
...
...
@@ -66,10 +66,10 @@ map_uri_fs(const char *uri) noexcept
assert
(
uri
!=
nullptr
);
assert
(
*
uri
!=
'/'
);
if
(
instance
->
storage
==
nullptr
)
if
(
global_
instance
->
storage
==
nullptr
)
return
nullptr
;
const
auto
music_dir_fs
=
instance
->
storage
->
MapFS
(
""
);
const
auto
music_dir_fs
=
global_
instance
->
storage
->
MapFS
(
""
);
if
(
music_dir_fs
.
IsNull
())
return
nullptr
;
...
...
@@ -84,10 +84,10 @@ std::string
map_fs_to_utf8
(
Path
path_fs
)
noexcept
{
if
(
path_fs
.
IsAbsolute
())
{
if
(
instance
->
storage
==
nullptr
)
if
(
global_
instance
->
storage
==
nullptr
)
return
std
::
string
();
const
auto
music_dir_fs
=
instance
->
storage
->
MapFS
(
""
);
const
auto
music_dir_fs
=
global_
instance
->
storage
->
MapFS
(
""
);
if
(
music_dir_fs
.
IsNull
())
return
std
::
string
();
...
...
src/win32/Win32Main.cxx
View file @
71a5c8b8
...
...
@@ -70,7 +70,7 @@ service_dispatcher(gcc_unused DWORD control, gcc_unused DWORD event_type,
switch
(
control
)
{
case
SERVICE_CONTROL_SHUTDOWN
:
case
SERVICE_CONTROL_STOP
:
instance
->
Break
();
global_
instance
->
Break
();
return
NO_ERROR
;
default:
return
NO_ERROR
;
...
...
@@ -106,7 +106,7 @@ console_handler(DWORD event)
// regardless our thread is still active.
// If this did not happen within 3 seconds
// let's shutdown anyway.
instance
->
Break
();
global_
instance
->
Break
();
// Under debugger it's better to wait indefinitely
// to allow debugging of shutdown code.
Sleep
(
IsDebuggerPresent
()
?
INFINITE
:
3000
);
...
...
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