Debarshi's suggestion about g_clear_object use.
Removed if (pointer != null) condition when using g_clear_object.
This commit is contained in:
committed by
Rene A. Viant Moran
parent
e1be309095
commit
1062d3e435
@@ -2,17 +2,17 @@
|
|||||||
/*
|
/*
|
||||||
* gcal-application.c
|
* gcal-application.c
|
||||||
* Copyright (C) 2012 Erick Pérez Castellanos <erickpc@gnome.org>
|
* Copyright (C) 2012 Erick Pérez Castellanos <erickpc@gnome.org>
|
||||||
*
|
*
|
||||||
* gnome-calendar is free software: you can redistribute it and/or modify it
|
* gnome-calendar is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the
|
* under the terms of the GNU General Public License as published by the
|
||||||
* Free Software Foundation, either version 3 of the License, or
|
* Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* gnome-calendar is distributed in the hope that it will be useful, but
|
* gnome-calendar is distributed in the hope that it will be useful, but
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
* See the GNU General Public License for more details.
|
* See the GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License along
|
* You should have received a copy of the GNU General Public License along
|
||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
@@ -96,8 +96,7 @@ gcal_application_finalize (GObject *object)
|
|||||||
g_return_if_fail (GCAL_IS_APPLICATION (object));
|
g_return_if_fail (GCAL_IS_APPLICATION (object));
|
||||||
priv = GCAL_APPLICATION (object)->priv;
|
priv = GCAL_APPLICATION (object)->priv;
|
||||||
|
|
||||||
if (priv->settings != NULL)
|
g_clear_object (&(priv->settings));
|
||||||
g_clear_object (&(priv->settings));
|
|
||||||
|
|
||||||
if (G_OBJECT_CLASS (gcal_application_parent_class)->finalize != NULL)
|
if (G_OBJECT_CLASS (gcal_application_parent_class)->finalize != NULL)
|
||||||
G_OBJECT_CLASS (gcal_application_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gcal_application_parent_class)->finalize (object);
|
||||||
@@ -166,7 +165,7 @@ gcal_application_startup (GApplication *app)
|
|||||||
gcal_application_set_app_menu (app);
|
gcal_application_set_app_menu (app);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_application_set_app_menu (GApplication *app)
|
gcal_application_set_app_menu (GApplication *app)
|
||||||
{
|
{
|
||||||
GcalApplicationPrivate *priv;
|
GcalApplicationPrivate *priv;
|
||||||
|
|||||||
+1
-2
@@ -613,8 +613,7 @@ gcal_manager_reload_view (GcalManager *manager,
|
|||||||
g_return_if_fail (priv->query != NULL);
|
g_return_if_fail (priv->query != NULL);
|
||||||
|
|
||||||
/* stopping */
|
/* stopping */
|
||||||
if (unit->view != NULL)
|
g_clear_object (&(unit->view));
|
||||||
g_clear_object (&(unit->view));
|
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
if (e_cal_client_get_view_sync (unit->client,
|
if (e_cal_client_get_view_sync (unit->client,
|
||||||
|
|||||||
+5
-10
@@ -246,17 +246,12 @@ gcal_toolbar_finalize (GObject *object)
|
|||||||
g_return_if_fail (GCAL_IS_TOOLBAR (object));
|
g_return_if_fail (GCAL_IS_TOOLBAR (object));
|
||||||
priv = GCAL_TOOLBAR (object)->priv;
|
priv = GCAL_TOOLBAR (object)->priv;
|
||||||
|
|
||||||
if (priv->add_button != NULL)
|
g_clear_object (&(priv->add_button));
|
||||||
g_clear_object (&(priv->add_button));
|
g_clear_object (&(priv->views_box));
|
||||||
if (priv->views_box != NULL)
|
g_clear_object (&(priv->right_box));
|
||||||
g_clear_object (&(priv->views_box));
|
|
||||||
if (priv->right_box != NULL)
|
|
||||||
g_clear_object (&(priv->right_box));
|
|
||||||
|
|
||||||
if (priv->back_button)
|
g_clear_object (&(priv->back_button));
|
||||||
g_clear_object (&(priv->back_button));
|
g_clear_object (&(priv->edit_button));
|
||||||
if (priv->edit_button)
|
|
||||||
g_clear_object (&(priv->edit_button));
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (gcal_toolbar_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gcal_toolbar_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user