Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 884
    • Issues 884
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 53
    • Merge requests 53
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • GLib
  • Issues
  • #1857

Closed
Open
Created Aug 01, 2019 by Milan Crha@mcrhaDeveloper

Invalid 'Consider using g_application_run()' runtime warning

Trying to run /usr/libexec/evolution-data-server/evolution-alarm-notify when one is already running shows a runtime warning:

(evolution-alarm-notify:6444): GLib-GIO-WARNING **: 18:33:46.329:
Your application did not unregister from D-Bus before destruction.
Consider using g_application_run().
  1. Which is misleading, because when you look into the code, then the g_application_run() is used there:
	g_application_register (G_APPLICATION (alarm_notify), NULL, &error);

	if (error != NULL) {
		g_printerr ("%s\n", error->message);
		g_error_free (error);
		g_object_unref (alarm_notify);
		exit (EXIT_FAILURE);
	}

	if (g_application_get_is_remote (G_APPLICATION (alarm_notify))) {
		g_object_unref (alarm_notify);
		return 0;
	}

#ifdef G_OS_UNIX
	g_unix_signal_add_full (
		G_PRIORITY_DEFAULT, SIGTERM,
		handle_term_signal, alarm_notify, NULL);
#endif

	exit_status = g_application_run (G_APPLICATION (alarm_notify), argc, argv);

	g_object_unref (alarm_notify);

The thing is that when the application notices it is already running it simply quits. That's the correct thing to do, is it not?

  1. I guess the unregistering from D-Bus is also wrong, because the g_application_register() should fail in this case, at least according to the developer documentation of that function.

  2. That this "hint" is a WARNING is also kinda bad idea, because if it's only a hint, which the word "consider" suggests, then having the warning sensitive to fatal-warnings makes things hard to use for end users (not for developers), if they use it for whatever reason.

I've currently installed:

glib2-2.60.6-1.fc30.x86_64
evolution-data-server-3.32.4-1.fc30.x86_64
Assignee
Assign to
Time tracking