plugins-mbm: Remove data->reopen_source timer before setting up new one
PATCH 2/2 plugins-mbm: Remove data->reopen_source timer before setting up new one
From: Tomasz Gregorek <[email protected]>
Check if there is a timer running already and remove it before creating a new one. This will prevent calling reopen_callback() more than if mbm_disconnect() is called more than once.
--- plugins/mbm.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
plugins/mbm.c +3 -0
@@ -351,6 +351,9 @@ static void mbm_disconnect(gpointer user_data) data->data_port =NULL ;/* Waiting for the +CGEV: ME DEACT might also work */ +if (data->reopen_source >0 ) +g_source_remove (data->reopen_source); + data->reopen_source =g_timeout_add_seconds (1 , reopen_callback, modem); }
Signature · 1 line
1.7.1
Hi Tomasz,
Quoted 6 lines
Check if there is a timer running already and remove it before creating a new one. This will prevent calling
reopen_callback()more than ifmbm_disconnect()is called more than once.--- plugins/mbm.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
patch has been applied, but same comment about the prefix applies here as well.
Regards
Marcel