mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 23:16:14 +01:00
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:
parent
1a20d56a89
commit
e16f82854a
@ -1347,6 +1347,8 @@ g_application_register (GApplication *application,
|
|||||||
void
|
void
|
||||||
g_application_hold (GApplication *application)
|
g_application_hold (GApplication *application)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (G_IS_APPLICATION (application));
|
||||||
|
|
||||||
if (application->priv->inactivity_timeout_id)
|
if (application->priv->inactivity_timeout_id)
|
||||||
{
|
{
|
||||||
g_source_remove (application->priv->inactivity_timeout_id);
|
g_source_remove (application->priv->inactivity_timeout_id);
|
||||||
@ -1381,6 +1383,8 @@ inactivity_timeout_expired (gpointer data)
|
|||||||
void
|
void
|
||||||
g_application_release (GApplication *application)
|
g_application_release (GApplication *application)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (G_IS_APPLICATION (application));
|
||||||
|
|
||||||
application->priv->use_count--;
|
application->priv->use_count--;
|
||||||
|
|
||||||
if (application->priv->use_count == 0 && application->priv->inactivity_timeout)
|
if (application->priv->use_count == 0 && application->priv->inactivity_timeout)
|
||||||
|
Loading…
Reference in New Issue
Block a user