Simplify use of GCancellable
g_cancellable_cancell can be called without checking for a NULL value. Use g_clear_object instead of g_object_unref
This commit is contained in:
parent
dd61d98ec5
commit
a64ef75ad7
9 changed files with 23 additions and 54 deletions
|
@ -1573,11 +1573,8 @@ search_for_remote_printers (THostSearchData *data)
|
|||
{
|
||||
PpNewPrinterDialogPrivate *priv = data->dialog->priv;
|
||||
|
||||
if (priv->remote_host_cancellable != NULL)
|
||||
{
|
||||
g_cancellable_cancel (priv->remote_host_cancellable);
|
||||
g_clear_object (&priv->remote_host_cancellable);
|
||||
}
|
||||
g_cancellable_cancel (priv->remote_host_cancellable);
|
||||
g_clear_object (&priv->remote_host_cancellable);
|
||||
|
||||
priv->remote_host_cancellable = g_cancellable_new ();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue