From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?SmluZMWZaWNoIE1ha292acSNa2E=?= Newsgroups: gmane.emacs.devel Subject: [PATCH] src/pgtkselect.c: Avoid Glib assertion warnings Date: Sun, 30 May 2021 11:47:11 +0200 Message-ID: <20210530114711.6f145d7d@holly> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/7SDourTeG..rzUYdencp/yg" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3404"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 30 16:01:43 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lnM0b-0000jZ-HP for ged-emacs-devel@m.gmane-mx.org; Sun, 30 May 2021 16:01:41 +0200 Original-Received: from localhost ([::1]:35482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnM0a-0001W3-Jr for ged-emacs-devel@m.gmane-mx.org; Sun, 30 May 2021 10:01:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnI2P-0007Vg-MW for emacs-devel@gnu.org; Sun, 30 May 2021 05:47:17 -0400 Original-Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]:41908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnI2O-0002Nv-0j for emacs-devel@gnu.org; Sun, 30 May 2021 05:47:17 -0400 Original-Received: by mail-ej1-x631.google.com with SMTP id gb17so11998383ejc.8 for ; Sun, 30 May 2021 02:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version; bh=EGg0GqmbET5DxhfCn2k4hpvp6a4Ox0SIUWyQHaIwkbI=; b=abqWCqI9+5RqZlpqiojjDF+qI4eZfH2jYDRa6PoyQAlYTNOBoWXNjnLwdLbJO//8Rh 1KYNa6edJIDhX8a/pMSWWpOKxWjTpRekdZsb54hoRYkuZIILn0XBFHbEZUoRQOXn5mxW Jg7oNQklFKIge/LrEhhq7yplpHpFUcWV72nXMyKIDdsTYulFlU2cVkHRkJQDEgPohr8/ mhouCchPj1pY6COFv02yY27KFuOWJhjf5HJwHXwDpXpXm0pS6y3/w5QL6Propqu+Vvff /VoN/w504aFqq94ND3pAvK97KVrNv/nj0JWQmkYuSkcJ8tK65ag+1fRVc20brDgEWrLy 6v7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version; bh=EGg0GqmbET5DxhfCn2k4hpvp6a4Ox0SIUWyQHaIwkbI=; b=Hpj/DfhxOofliSOGCLROrT7sSxLVZDJhwzMiTspsHLNXb7oWqQZmm765TlHblS7fdx tR7d3385iWbwG10OxOn8J+vBKtn4PIWUYmlY7D3m0PwKfG+pNoywrbwEtbJJjIEKmlFY RoZDxI/VTFriQrX58+wU7HdA09QuMTdGUuU5kgbcLeYXELB/hAOKK/sf4HO44Y4N1KV7 Fuks+En/vxUaOt1jATZJJFC+FgwYhJSFdPU5Ya8LOwVWhqFgLj7BqRzcqTi+JxuKH1Dp /WdIVQFv37+gfpibTsergHKge+IyoVZG7gojZ8bfSlkXL9uY/JykAGmvG9/yIKgotrls 1+zw== X-Gm-Message-State: AOAM5318upR5ElghN2jSJLPhWuu61xt8d1EVoeDSBsIV5IH1q1DSGH1a J2fHOOrXWXpy7fxhSI6ya0eNFi8sojOhbw== X-Google-Smtp-Source: ABdhPJzXmGMHBQs6nzC5jiNI6NhZwdR0mHNb76I1oJh8+kHFvtXZyPohVWCy5HaE57kFY9xzU26MCw== X-Received: by 2002:a17:906:4d13:: with SMTP id r19mr17265577eju.496.1622368033607; Sun, 30 May 2021 02:47:13 -0700 (PDT) Original-Received: from holly (ip-89-177-165-220.net.upcbroadband.cz. [89.177.165.220]) by smtp.gmail.com with ESMTPSA id i5sm5290699edt.11.2021.05.30.02.47.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 May 2021 02:47:13 -0700 (PDT) X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=makovick@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 30 May 2021 10:00:22 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270128 Archived-At: --MP_/7SDourTeG..rzUYdencp/yg Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, when the system clipboard has no owner, PGTK Emacs repeatedly shows assertion warnings, like (emacs:8121): GLib-GObject-CRITICAL **: 11:28:16.784: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed The attached trivial one-liner fixes this. -- Jindrich Makovicka --MP_/7SDourTeG..rzUYdencp/yg Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-src-pgtkselect.c-Avoid-Glib-assertion-warnings.patch >From db777bd34f1452281963a4db27914a6a31a29549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jind=C5=99ich=20Makovi=C4=8Dka?= Date: Sun, 30 May 2021 11:40:45 +0200 Subject: [PATCH] * src/pgtkselect.c: Avoid Glib assertion warnings Do not call g_object_get_qdata, when the clipboard has no owner, and obj is NULL. Just return Qnil immediately. --- src/pgtkselect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pgtkselect.c b/src/pgtkselect.c index 8ab74744f3..447c839f45 100644 --- a/src/pgtkselect.c +++ b/src/pgtkselect.c @@ -518,7 +518,7 @@ DEFUN ("pgtk-selection-owner-p", Fpgtk_selection_owner_p, Spgtk_selection_owner_ obj = gtk_clipboard_get_owner (cb); - return g_object_get_qdata (obj, quark_data) != NULL ? Qt : Qnil; + return obj && g_object_get_qdata (obj, quark_data) != NULL ? Qt : Qnil; } -- 2.32.0.rc0 --MP_/7SDourTeG..rzUYdencp/yg--