Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
5b97bae6
Commit
5b97bae6
authored
13 years ago
by
Rafaël Carré
Browse files
Options
Downloads
Patches
Plain Diff
callable_obj: fix double free
fix display of current codec remove unused struct members
parent
166dfd2f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gnome/src/actions.c
+2
-1
2 additions, 1 deletion
gnome/src/actions.c
gnome/src/callable_obj.c
+15
-43
15 additions, 43 deletions
gnome/src/callable_obj.c
gnome/src/callable_obj.h
+0
-8
0 additions, 8 deletions
gnome/src/callable_obj.h
with
17 additions
and
52 deletions
gnome/src/actions.c
+
2
−
1
View file @
5b97bae6
...
...
@@ -451,7 +451,8 @@ sflphone_hang_up()
calltree_update_call
(
history
,
selectedCall
,
NULL
);
stop_call_clock
(
selectedCall
);
if
(
selectedCall
)
stop_call_clock
(
selectedCall
);
calltree_update_clock
();
}
...
...
This diff is collapsed.
Click to expand it.
gnome/src/callable_obj.c
+
15
−
43
View file @
5b97bae6
...
...
@@ -80,18 +80,20 @@ gchar* call_get_peer_number (const gchar *format)
gchar
*
call_get_audio_codec
(
callable_obj_t
*
obj
)
{
gchar
*
result
=
NULL
;
if
(
obj
)
{
gchar
*
const
audio_codec
=
dbus_get_current_audio_codec_name
(
obj
);
const
codec_t
*
const
codec
=
codec_list_get_by_name
(
audio_codec
,
NULL
);
if
(
codec
)
{
result
=
g_markup_printf_escaped
(
"%s/%i"
,
audio_codec
,
codec
->
sample_rate
);
g_free
(
audio_codec
);
account_t
*
acc
=
account_list_get_by_id
(
obj
->
_accountID
);
if
(
acc
)
{
const
codec_t
*
const
codec
=
codec_list_get_by_name
(
audio_codec
,
acc
->
codecs
);
if
(
codec
)
{
gchar
*
result
=
g_markup_printf_escaped
(
"%s/%i"
,
audio_codec
,
codec
->
sample_rate
);
g_free
(
audio_codec
);
return
result
;
}
}
}
else
result
=
g_strdup
(
""
);
return
result
;
return
g_strdup
(
""
);
}
void
call_add_error
(
callable_obj_t
*
call
,
gpointer
dialog
)
...
...
@@ -173,19 +175,8 @@ void threaded_clock_incrementer (void *pc)
void
stop_call_clock
(
callable_obj_t
*
c
)
{
DEBUG
(
"CallableObj: Stop call clock"
);
if
(
!
c
)
{
ERROR
(
"CallableObj: Callable object is NULL"
);
return
;
}
if
(
c
->
_type
==
CALL
&&
c
->
clockStarted
)
{
if
(
c
->
_type
==
CALL
&&
c
->
clockStarted
)
c
->
clockStarted
=
0
;
/// no need to join here, only need to call g_thread_exit at the end of the threaded function
// g_thread_join (c->tid);
}
}
callable_obj_t
*
create_new_call
(
callable_type_t
type
,
call_state_t
state
,
...
...
@@ -194,23 +185,16 @@ callable_obj_t *create_new_call (callable_type_t type, call_state_t state,
const
gchar
*
const
peer_name
,
const
gchar
*
const
peer_number
)
{
GError
*
err1
=
NULL
;
callable_obj_t
*
obj
;
DEBUG
(
"CallableObj: Create new call"
);
DEBUG
(
"CallableObj: Account: %s"
,
accountID
);
DEBUG
(
"CallableObj: Create new call (Account: %s)"
,
accountID
);
// Allocate memory
obj
=
g_new0
(
callable_obj_t
,
1
);
callable_obj_t
*
obj
=
g_new0
(
callable_obj_t
,
1
);
obj
->
_error_dialogs
=
g_ptr_array_new
();
// Set fields
obj
->
_type
=
type
;
obj
->
_state
=
state
;
obj
->
_state_code
=
0
;
obj
->
_state_code_description
=
NULL
;
if
(
g_strcasecmp
(
callID
,
""
)
==
0
)
{
...
...
@@ -221,36 +205,25 @@ callable_obj_t *create_new_call (callable_type_t type, call_state_t state,
else
obj
->
_callID
=
g_strdup
(
callID
);
obj
->
_confID
=
NULL
;
obj
->
_historyConfID
=
NULL
;
obj
->
_accountID
=
g_strdup
(
accountID
);
set_timestamp
(
&
(
obj
->
_time_start
));
set_timestamp
(
&
(
obj
->
_time_current
));
set_timestamp
(
&
(
obj
->
_time_stop
));
obj
->
_srtp_cipher
=
NULL
;
obj
->
_sas
=
NULL
;
obj
->
_peer_name
=
g_strdup
(
peer_name
);
obj
->
_peer_number
=
g_strdup
(
peer_number
);
obj
->
_trsft_to
=
NULL
;
obj
->
_peer_info
=
get_peer_info
(
peer_name
,
peer_number
);
obj
->
_audio_codec
=
NULL
;
obj
->
_recordfile
=
NULL
;
obj
->
_record_is_playing
=
FALSE
;
obj
->
clockStarted
=
1
;
if
(
obj
->
_type
==
CALL
)
{
// pthread_create(&(obj->tid), NULL, threaded_clock_incrementer, obj)
;
if
(
(
obj
->
tid
=
g_thread_create
(
(
GThreadFunc
)
threaded_clock_incrementer
,
(
void
*
)
obj
,
TRUE
,
&
err1
))
==
NULL
)
{
GError
*
err1
=
NULL
;
if
(
!
g_thread_create
(
(
GThreadFunc
)
threaded_clock_incrementer
,
(
void
*
)
obj
,
TRUE
,
&
err1
))
{
DEBUG
(
"Thread creation failed!"
);
g_error_free
(
err1
)
;
}
}
obj
->
_time_added
=
0
;
return
obj
;
}
...
...
@@ -377,7 +350,6 @@ void free_callable_obj_t (callable_obj_t *c)
g_free
(
c
->
_peer_number
);
g_free
(
c
->
_trsft_to
);
g_free
(
c
->
_peer_info
);
g_free
(
c
->
_audio_codec
);
g_free
(
c
->
_recordfile
);
g_free
(
c
);
...
...
This diff is collapsed.
Click to expand it.
gnome/src/callable_obj.h
+
0
−
8
View file @
5b97bae6
...
...
@@ -149,9 +149,6 @@ typedef struct {
*/
GPtrArray
*
_error_dialogs
;
/* The audio codec used for this call, if applicable */
gchar
*
_audio_codec
;
/**
* The recording file for this call, if NULL, no recording available
* Should be used only for history items
...
...
@@ -167,11 +164,6 @@ typedef struct {
/* Associated IM widget */
GtkWidget
*
_im_widget
;
/**
* Thread id to increment clock
*/
GThread
*
tid
;
int
clockStarted
;
time_t
_time_added
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment