unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] src/pgtkselect.c: Avoid Glib assertion warnings
@ 2021-05-30  9:47 Jindřich Makovička
  2021-06-08 15:48 ` Yuuki Harano
  0 siblings, 1 reply; 2+ messages in thread
From: Jindřich Makovička @ 2021-05-30  9:47 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

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

[-- Attachment #2: 0001-src-pgtkselect.c-Avoid-Glib-assertion-warnings.patch --]
[-- Type: text/x-patch, Size: 877 bytes --]

From db777bd34f1452281963a4db27914a6a31a29549 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jind=C5=99ich=20Makovi=C4=8Dka?= <makovick@gmail.com>
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] src/pgtkselect.c: Avoid Glib assertion warnings
  2021-05-30  9:47 [PATCH] src/pgtkselect.c: Avoid Glib assertion warnings Jindřich Makovička
@ 2021-06-08 15:48 ` Yuuki Harano
  0 siblings, 0 replies; 2+ messages in thread
From: Yuuki Harano @ 2021-06-08 15:48 UTC (permalink / raw)
  To: makovick; +Cc: emacs-devel


On Sun, 30 May 2021 11:47:11 +0200,
	Jindřich Makovička <makovick@gmail.com> wrote:
> 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.

Thanks. Applied.

-- 
Yuuki Harano



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-08 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-30  9:47 [PATCH] src/pgtkselect.c: Avoid Glib assertion warnings Jindřich Makovička
2021-06-08 15:48 ` Yuuki Harano

unofficial mirror of emacs-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-devel/0 emacs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-devel emacs-devel/ https://yhetil.org/emacs-devel \
		emacs-devel@gnu.org
	public-inbox-index emacs-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.devel
	nntp://news.gmane.io/gmane.emacs.devel


code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs.git

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git