Silence some uncontroversial warnings
[platform/upstream/glib.git] / gio / gtlsinteraction.c
index 8059dc3..ba94fe1 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  *
  * Author: Stef Walter <stefw@collabora.co.uk>
  */
@@ -374,11 +372,11 @@ g_tls_interaction_invoke_ask_password (GTlsInteraction    *interaction,
   g_return_val_if_fail (G_IS_TLS_PASSWORD (password), G_TLS_INTERACTION_UNHANDLED);
   g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), G_TLS_INTERACTION_UNHANDLED);
 
-  closure = invoke_closure_new (interaction, G_OBJECT (password), cancellable);
-
   klass = G_TLS_INTERACTION_GET_CLASS (interaction);
+
   if (klass->ask_password)
     {
+      closure = invoke_closure_new (interaction, G_OBJECT (password), cancellable);
       g_main_context_invoke (interaction->priv->context,
                              on_invoke_ask_password_sync, closure);
       result = invoke_closure_wait_and_free (closure, error);
@@ -386,6 +384,8 @@ g_tls_interaction_invoke_ask_password (GTlsInteraction    *interaction,
   else if (klass->ask_password_async)
     {
       g_return_val_if_fail (klass->ask_password_finish, G_TLS_INTERACTION_UNHANDLED);
+
+      closure = invoke_closure_new (interaction, G_OBJECT (password), cancellable);
       g_main_context_invoke (interaction->priv->context,
                              on_invoke_ask_password_async_as_sync, closure);
 
@@ -394,7 +394,6 @@ g_tls_interaction_invoke_ask_password (GTlsInteraction    *interaction,
   else
     {
       result = G_TLS_INTERACTION_UNHANDLED;
-      invoke_closure_free (closure);
     }
 
   return result;
@@ -664,11 +663,11 @@ g_tls_interaction_invoke_request_certificate (GTlsInteraction    *interaction,
   g_return_val_if_fail (G_IS_TLS_CONNECTION (connection), G_TLS_INTERACTION_UNHANDLED);
   g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), G_TLS_INTERACTION_UNHANDLED);
 
-  closure = invoke_closure_new (interaction, G_OBJECT (connection), cancellable);
-
   klass = G_TLS_INTERACTION_GET_CLASS (interaction);
+
   if (klass->request_certificate)
     {
+      closure = invoke_closure_new (interaction, G_OBJECT (connection), cancellable);
       g_main_context_invoke (interaction->priv->context,
                              on_invoke_request_certificate_sync, closure);
       result = invoke_closure_wait_and_free (closure, error);
@@ -676,6 +675,8 @@ g_tls_interaction_invoke_request_certificate (GTlsInteraction    *interaction,
   else if (klass->request_certificate_async)
     {
       g_return_val_if_fail (klass->request_certificate_finish, G_TLS_INTERACTION_UNHANDLED);
+
+      closure = invoke_closure_new (interaction, G_OBJECT (connection), cancellable);
       g_main_context_invoke (interaction->priv->context,
                              on_invoke_request_certificate_async_as_sync, closure);
 
@@ -684,7 +685,6 @@ g_tls_interaction_invoke_request_certificate (GTlsInteraction    *interaction,
   else
     {
       result = G_TLS_INTERACTION_UNHANDLED;
-      invoke_closure_free (closure);
     }
 
   return result;