Commit 53949257 authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

fix some memory leaks in gtk

parent 8a6fb40b
......@@ -84,13 +84,13 @@ void linphone_gtk_call_update_tab_header(LinphoneCall *call,gboolean pause){
GtkWidget *i=NULL;
GtkWidget *l;
gchar *text;
if(pause){
i=gtk_image_new_from_stock(GTK_STOCK_MEDIA_PAUSE,GTK_ICON_SIZE_SMALL_TOOLBAR);
} else {
i=create_pixmap ("startcall-small.png");
}
text=g_strdup_printf(_("Call #%i"),call_index);
l=gtk_label_new (text);
gtk_box_pack_start (GTK_BOX(new_label),i,FALSE,FALSE,0);
......@@ -98,6 +98,7 @@ void linphone_gtk_call_update_tab_header(LinphoneCall *call,gboolean pause){
gtk_notebook_set_tab_label(notebook,w,new_label);
gtk_widget_show_all(new_label);
g_free(text);
}
static void linphone_gtk_in_call_set_animation_image(GtkWidget *callview, const char *image_name, gboolean is_stock){
......@@ -181,7 +182,7 @@ static void conference_button_clicked(GtkWidget *button, gpointer call_ref){
gtk_widget_set_sensitive(button,FALSE);
g_object_set_data(G_OBJECT(linphone_gtk_get_main_window()),"conf_frame",NULL);
linphone_core_add_all_to_conference(linphone_gtk_get_core());
}
void linphone_gtk_enable_conference_button(LinphoneCore *lc, gboolean value){
......@@ -271,7 +272,7 @@ static void _refresh_call_stats(GtkWidget *callstats, LinphoneCall *call){
gchar *size_s=g_strdup_printf(_("%ix%i"),size_sent.width,size_sent.height);
gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"video_size_recv")),size_r);
gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"video_size_sent")),size_s);
tmp=g_strdup_printf(_("download: %f\nupload: %f (kbit/s)"),vs->download_bandwidth,vs->upload_bandwidth);
g_free(size_r);
g_free(size_s);
......@@ -286,7 +287,7 @@ static void _refresh_call_stats(GtkWidget *callstats, LinphoneCall *call){
audio_media_connectivity = ice_state_to_string(as->ice_state);
}
gtk_label_set_text(GTK_LABEL(linphone_gtk_get_widget(callstats,"audio_media_connectivity")),audio_media_connectivity);
if (has_video){
if(vs->upnp_state != LinphoneUpnpStateNotAvailable && vs->upnp_state != LinphoneUpnpStateIdle) {
video_media_connectivity = upnp_state_to_string(vs->upnp_state);
......@@ -295,7 +296,7 @@ static void _refresh_call_stats(GtkWidget *callstats, LinphoneCall *call){
}
}else video_media_connectivity=NULL;
gtk_label_set_text(GTK_LABEL(linphone_gtk_get_widget(callstats,"video_media_connectivity")),video_media_connectivity);
if (as->round_trip_delay>0){
tmp=g_strdup_printf(_("%.3f seconds"),as->round_trip_delay);
gtk_label_set_text(GTK_LABEL(linphone_gtk_get_widget(callstats,"round_trip_time")),tmp);
......@@ -467,7 +468,7 @@ void linphone_gtk_remove_in_call_view(LinphoneCall *call){
static void display_peer_name_in_label(GtkWidget *label, const LinphoneAddress *from){
const char *displayname=NULL;
const char *id;
char *id;
char *uri_label;
displayname=linphone_address_get_display_name(from);
id=linphone_address_as_string_uri_only(from);
......@@ -479,6 +480,7 @@ static void display_peer_name_in_label(GtkWidget *label, const LinphoneAddress *
uri_label=g_markup_printf_escaped("<span size=\"large\"><i>%s</i></span>\n",id);
gtk_label_set_markup(GTK_LABEL(label),uri_label);
g_free(uri_label);
g_free(id);
}
void linphone_gtk_in_call_view_set_calling(LinphoneCall *call){
......@@ -686,10 +688,10 @@ void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
GtkWidget *call_stats=(GtkWidget*)g_object_get_data(G_OBJECT(callview),"call_stats");
display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
gtk_label_set_markup(GTK_LABEL(status),in_conf ? _("In conference") : _("<b>In call</b>"));
gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"conference_button"),!in_conf);
gtk_widget_set_sensitive(linphone_gtk_get_widget(callview,"transfer_button"),!in_conf);
......@@ -698,7 +700,7 @@ void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
linphone_gtk_call_update_tab_header(call,FALSE);
linphone_gtk_enable_mute_button(
GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),TRUE);
if (taskid==0){
taskid=g_timeout_add(250,(GSourceFunc)linphone_gtk_in_call_view_refresh,call);
g_object_set_data(G_OBJECT(callview),"taskid",GINT_TO_POINTER(taskid));
......@@ -772,7 +774,7 @@ void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_m
linphone_gtk_enable_mute_button(
GTK_BUTTON(linphone_gtk_get_widget(callview,"incall_mute")),FALSE);
linphone_gtk_enable_hold_button(call,FALSE,TRUE);
if (taskid!=0) g_source_remove(taskid);
g_timeout_add_seconds(2,(GSourceFunc)in_call_view_terminated,call);
if (in_conf)
......@@ -909,7 +911,7 @@ void linphone_gtk_record_call_toggled(GtkWidget *button){
return;
}
message=g_strdup_printf(_("<small><i>Recording into\n%s %s</i></small>"),filepath,active ? "" : _("(Paused)"));
if (active){
if (call)
linphone_call_start_recording(call);
......@@ -920,7 +922,7 @@ void linphone_gtk_record_call_toggled(GtkWidget *button){
linphone_call_stop_recording(call);
else
linphone_core_stop_conference_recording(lc);
}
gtk_label_set_markup(GTK_LABEL(label),message);
g_free(message);
......
......@@ -1772,7 +1772,7 @@
<property name="can_focus">False</property>
<property name="model">model4</property>
<property name="active">0</property>
<signal name="changed" handler="linphone_gtk_internet_kind_changed" swapped="no"/>
<!-- <signal name="changed" handler="linphone_gtk_internet_kind_changed" swapped="no"/> -->
<child>
<object class="GtkCellRendererText" id="renderer4"/>
<attributes>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment