Hi Sjur,
> > so these are declared as get_modems(void) btw. The compiler should have
> > warned you about this.
>
> I don't get a compiler warning for this one, not even with -Wall
> -Wextra -Wpedantic on GCC 4.4.3.
> But a new rule in the coding-style should perhaps be added, e.g:
>
> M15: Use void if function has no parameters
> ====================================
> A function with no parameters must use void in the parameter list.
> Example:
> 1)
> void foo(void)
> {
> }
>
> 2)
> void foo() // Wrong
> {
> }
please go ahead and send a patch for this. I am happily adding it.
> ...
> >> +static void mgr_disconnect(DBusConnection *connection, void *user_data)
> >> +{
> >> + g_hash_table_remove_all(modem_list);
> >> + g_dbus_remove_watch(connection, property_changed_watch);
> >> +}
> >> +
> ....
> >> +static void stemgr_exit()
> >> +{
> >> + g_hash_table_destroy(modem_list);
> >> + g_dbus_remove_watch(connection, modem_daemon_watch);
> >> + g_dbus_remove_watch(connection, property_changed_watch);
> >
> > This is not right. You need to remove the property_changed_watch in the
> > disconnect callback. Otherwise if your daemon restarts twice you
> > actually have two watches.
> It's already present in mgr_disconnect, did you miss that?
I did miss that. So you are correct, but you should add
property_changed_watch = 0
to mgr_disconnect.
And then do this in stemgr_exit
if (property_changed_watch > 0)
g_dbus_remove_watch(...
> In the previous review 2011/1/5 you said:
> > +static void stemgr_exit()
> > +{
> >The only thing you missed here is to remove the property changed watch
> >in case it was registered (aka the init daemon started).
>
> Anyway, I think the watch handing in the latest patch is correct,
> we need to do remove_watch for property_changed_watch
> in both stemgr_exit and in stemgr_disconnect.
I got lost a little bit, but you still need to make sure to not remove a
watch on plugin exit in case modem init manager not running as I
mentioned above.
Regards
Marcel
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono