From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: shr using `make-xwidget' incorrectly Date: Thu, 11 Nov 2021 08:58:44 +0200 Message-ID: <831r3n2n6j.fsf@gnu.org> References: <87sfw31mok.fsf.ref@yahoo.com> <87sfw31mok.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 11 07:59:36 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 1ml43b-0002Lo-Rt for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Nov 2021 07:59:36 +0100 Original-Received: from localhost ([::1]:59508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ml43a-0006Yr-UX for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Nov 2021 01:59:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml42s-0005p3-3U for emacs-devel@gnu.org; Thu, 11 Nov 2021 01:58:50 -0500 Original-Received: from [2001:470:142:3::e] (port=43566 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml42r-0002UF-Iz; Thu, 11 Nov 2021 01:58:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wwgSsUWygIEUYupm3PT5AOKuFrD6UGiFdamk/xNrhaE=; b=VKAwxfZ9DaV1 OaP2IEhI3nw49w88jWhJrXIJ5u2+mYbFV99YDRGUiq2thVwsrFYLLn1n3e2Jnlb60wFW2bU2D/m1z F/Sp0n45GutlN8GoMyY+EmdPxhjwjjt+dBNYjpr19f2iYILHqJxVxhU7FEbpCORtCFlZcfaPe6VgO SOPK+lWKHi4STdfU07puLrdRxOfPiDxyYKcRlBjwVsbsbkSKdiycH8xCtS23DZtHCsMazDaCy/b3R EomTGq40770GRcK7cV8Vk94dC9CZaMA2lyD5SKua07mtbFj3hPVLKYCdw08jolOd9SEdLgCKTklVd S1wufu6PdVpSA6GfJj3APA==; Original-Received: from [87.69.77.57] (port=3878 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml42o-00076m-S0; Thu, 11 Nov 2021 01:58:49 -0500 In-Reply-To: <87sfw31mok.fsf@yahoo.com> (message from Po Lu on Thu, 11 Nov 2021 09:54:51 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:279228 Archived-At: > From: Po Lu > Cc: larsi@gnus.org > Date: Thu, 11 Nov 2021 09:54:51 +0800 > > Which reminds me of another problem (in the Emacs 28 xwidget code as > well): If an xwidget's buffer is killed, but references to it still > exist somewhere, crashes can happen, because the GTK resources allocated > to the xwidget are killed in `kill_buffer_xwidgets' and not during > garbage collection. > > I think the best thing to do in this case would be to introduce a > `dead' state for xwidgets, not unlike killed buffers and dead frames, > which an xwidget is set to after being killed. > > Then, performing any sort of operation on a killed xwidget can either > throw an error, or do nothing. Why can't we release the GTK resources when such a buffer is killed?