Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
medialibrary
Commits
65095748
Commit
65095748
authored
May 20, 2014
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clear cache when releasing the media library
parent
832c0ea0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
src/Cache.h
src/Cache.h
+6
-0
src/MediaLibrary.cpp
src/MediaLibrary.cpp
+10
-0
src/MediaLibrary.h
src/MediaLibrary.h
+1
-0
No files found.
src/Cache.h
View file @
65095748
...
...
@@ -119,6 +119,12 @@ class Cache
return
destroy
(
dbConnection
,
key
);
}
static
void
clear
()
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
Mutex
);
Store
.
clear
();
}
private:
static
std
::
unordered_map
<
typename
CACHEPOLICY
::
KeyType
,
std
::
shared_ptr
<
IMPL
>
>
Store
;
static
std
::
mutex
Mutex
;
...
...
src/MediaLibrary.cpp
View file @
65095748
...
...
@@ -12,6 +12,16 @@ MediaLibrary::MediaLibrary()
{
}
MediaLibrary
::~
MediaLibrary
()
{
File
::
clear
();
Label
::
clear
();
Album
::
clear
();
AlbumTrack
::
clear
();
Show
::
clear
();
ShowEpisode
::
clear
();
}
bool
MediaLibrary
::
initialize
(
const
std
::
string
&
dbPath
)
{
int
res
=
sqlite3_open
(
dbPath
.
c_str
(),
&
m_dbConnection
);
...
...
src/MediaLibrary.h
View file @
65095748
...
...
@@ -9,6 +9,7 @@ class MediaLibrary : public IMediaLibrary
{
public:
MediaLibrary
();
~
MediaLibrary
();
virtual
bool
initialize
(
const
std
::
string
&
dbPath
);
virtual
bool
files
(
std
::
vector
<
FilePtr
>&
res
);
virtual
FilePtr
file
(
const
std
::
string
&
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