Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-daemon
Commits
2deb5890
Commit
2deb5890
authored
Apr 11, 2012
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* #9774: make sure sipvoiplink is destroyed before accounts are unloaded
parent
018f1ab5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
daemon/src/managerimpl.cpp
daemon/src/managerimpl.cpp
+1
-0
daemon/src/sip/sipvoiplink.cpp
daemon/src/sip/sipvoiplink.cpp
+14
-4
daemon/src/sip/sipvoiplink.h
daemon/src/sip/sipvoiplink.h
+7
-0
No files found.
daemon/src/managerimpl.cpp
View file @
2deb5890
...
...
@@ -130,6 +130,7 @@ void ManagerImpl::terminate()
saveConfig
();
SIPVoIPLink
::
destroy
();
// Unload account map AFTER destroying
// the SIPVoIPLink, the link still needs the accounts for pjsip cleanup
unloadAccountMap
();
...
...
daemon/src/sip/sipvoiplink.cpp
View file @
2deb5890
/*
* Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Savoir-Faire Linux Inc.
*
* Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
* Author: Yun Liu <yun.liu@savoirfairelinux.com>
* Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>
...
...
@@ -65,11 +64,13 @@
#include <istream>
#include <utility> // for std::pair
#include <map>
using
namespace
sfl
;
SIPVoIPLink
*
SIPVoIPLink
::
instance_
=
0
;
bool
SIPVoIPLink
::
destroyed_
=
false
;
namespace
{
/** A map to retreive SFLphone internal call id
...
...
@@ -507,8 +508,17 @@ SIPVoIPLink::~SIPVoIPLink()
SIPVoIPLink
*
SIPVoIPLink
::
instance
()
{
static
SIPVoIPLink
instance_
;
return
&
instance_
;
assert
(
!
destroyed_
);
if
(
!
instance_
)
instance_
=
new
SIPVoIPLink
;
return
instance_
;
}
void
SIPVoIPLink
::
destroy
()
{
delete
instance_
;
destroyed_
=
true
;
instance_
=
0
;
}
// Called from EventThread::run (not main thread)
...
...
daemon/src/sip/sipvoiplink.h
View file @
2deb5890
...
...
@@ -71,6 +71,11 @@ class SIPVoIPLink : public VoIPLink {
*/
static
SIPVoIPLink
*
instance
();
/**
* Destroy the singleton instance
*/
static
void
destroy
();
/**
* Event listener. Each event send by the call manager is received and handled from here
*/
...
...
@@ -248,6 +253,8 @@ class SIPVoIPLink : public VoIPLink {
EventThread
evThread_
;
friend
class
SIPTest
;
static
bool
destroyed_
;
static
SIPVoIPLink
*
instance_
;
};
#endif // SIPVOIPLINK_H_
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