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 10:01:58 +0200 Message-ID: <83tugj15op.fsf@gnu.org> References: <87sfw31mok.fsf.ref@yahoo.com> <87sfw31mok.fsf@yahoo.com> <831r3n2n6j.fsf@gnu.org> <87fss3xjdc.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29104"; 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 09:03:21 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 1ml53J-0007O5-E8 for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Nov 2021 09:03:21 +0100 Original-Received: from localhost ([::1]:53136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ml53H-0002K4-G6 for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Nov 2021 03:03:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml521-0001bd-CI for emacs-devel@gnu.org; Thu, 11 Nov 2021 03:02:01 -0500 Original-Received: from [2001:470:142:3::e] (port=44906 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 1ml521-00022v-30; Thu, 11 Nov 2021 03:02:01 -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=o/Bv+Sz36uTs1zWSPH0FjPQJZAjgYpbqmUh0YSBG3rE=; b=k3HZfja3NWC+ Lb9aqbowRkMJPruHmdDbfvglP1VDYg+wIJRj7xnVpLY+Dr1G/24obtbZQKb9d2B63aC1JYPnXORX7 IEtfSJ3biHA1fdnsCC69TCFdEdsSQgbmgXNY1aB3Hsd0G7ouI5TlHoMCHtjltMqsXOTKSdGb3YWxN SvdiqiO9xZ7Wizf/fyXBuFe6bx0ISQsoJ6xTIGXBFQaxwrT/rtiItS1mIxpufzApwvx/68+1lUCUw r42C6JpvuUzQ8lSiX3KmW+jSzw71/q4DnE2n4VL7+GHHVwcbMy27R0gDuzcs38m9iFaTVAE+G1biS rMxk3emQ4uk5jCEPxLt4VA==; Original-Received: from [87.69.77.57] (port=3849 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 1ml520-0003vp-KM; Thu, 11 Nov 2021 03:02:00 -0500 In-Reply-To: <87fss3xjdc.fsf@yahoo.com> (message from Po Lu on Thu, 11 Nov 2021 15:05:19 +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:279233 Archived-At: > From: Po Lu > Cc: larsi@gnus.org, emacs-devel@gnu.org > Date: Thu, 11 Nov 2021 15:05:19 +0800 > > Eli Zaretskii writes: > > >> 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? > > We are releasing the GTK resources when such a buffer is killed. This > is the problem here: code that uses `CHECK_XWIDGET' won't catch the case > where the GTK resources are released, but there are still references to > the xwidget, which causes use-after-frees when trying to redisplay the > xwidget, or when calling, say, `xwidget-webkit-goto-uri' on the xwidget. Isn't there some indication in the xwidget that its GTK resources were freed? If not, can we add such an indication and set it when we free those resources?