Add return-if-fail checks to g_application_hold/release

This is our common practice for public API.
https://bugzilla.gnome.org/show_bug.cgi?id=685208
This commit is contained in:
Matthias Clasen 2012-10-15 19:34:36 -04:00
parent 1a20d56a89
commit e16f82854a

View File

@ -1347,6 +1347,8 @@ g_application_register (GApplication *application,
void
g_application_hold (GApplication *application)
{
g_return_if_fail (G_IS_APPLICATION (application));
if (application->priv->inactivity_timeout_id)
{
g_source_remove (application->priv->inactivity_timeout_id);
@ -1381,6 +1383,8 @@ inactivity_timeout_expired (gpointer data)
void
g_application_release (GApplication *application)
{
g_return_if_fail (G_IS_APPLICATION (application));
application->priv->use_count--;
if (application->priv->use_count == 0 && application->priv->inactivity_timeout)