From patchwork Wed Mar 2 20:52:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 547542 Delivered-To: patch@linaro.org Received: by 2002:ac0:f585:0:0:0:0:0 with SMTP id s5csp48719imq; Wed, 2 Mar 2022 13:26:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzMpdg8/4eOzjAFxGOdR92U0ixiXGYZikNfiysZx50rjN9pVmjR2vZaPFt5JU+zr/1nonJ X-Received: by 2002:a81:cf02:0:b0:2d0:b68c:cf30 with SMTP id u2-20020a81cf02000000b002d0b68ccf30mr32697119ywi.510.1646256388745; Wed, 02 Mar 2022 13:26:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646256388; cv=none; d=google.com; s=arc-20160816; b=ZIyMCMSsR9q6hLCqkccdXsTeBFo0FPHi8VQaW8oNpXBiFsFJ9Fc6ZRZPdfzDQWTQT3 umRZPQVxALWxJCMPKFl+1pqBTVgd1LducG2a38N2p7HUpsIPwJRUbXev8VumxZO4A3aW U2l5uiW1aWGxIPS1tLUH20km9qrs4EDkb1n9QiaVHWU8PEKGH4E6HAmwlFEWh8LlMfz2 M4FwYEUw+QcoQfQHh95t08ioIlGtw2aSvB/iVU8B8frC+TNIPpHtiIW5xAHvR8RQAhgZ qs/40Vtud8OAT9vn6XUGOy4Zyfv4LDBbjkZOnJhozz4CTl6eICjGLEX6xDqvjyuttQnc m8Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=CZ5TYYnUc0e1hEuIV2ZzXVXaht7eB3zPn5/u5sClZ4M=; b=q2QxuZLhb+WSY9BW2adgZW3v/7A1JrIjrmtbRfHUNV/TLEUxO7+ZdiZ1L06ufaSCJt Dr02JS1wLb+vkyVBIYpN0j8G5/vgugkwjVx3nGVvwqi9G8Mv92zsF709cUqPo0ROOgEQ eI9M2a43r2Qadihot04ViD25Yok5m7KB/Z9yxYAI6V0EXuVuVlE3fSLYrjLT7LWsMwwF /yUELL3A/HZrdLY3vqcmUwlXsUL/3Lrr1miqF0b1W9sjW3Z+7bk30YkLP0FvrikvhVya 7ZeRGKqZvR9XzUspkrJC5h8+Frlwe07lQYtqnyKZsQZRieIR7jYd6AdPL8iA7eHUBjaF DT8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OscOzPwP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f11-20020a5b01cb000000b00628832be789si90602ybp.372.2022.03.02.13.26.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 Mar 2022 13:26:28 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OscOzPwP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPWUO-0007YP-92 for patch@linaro.org; Wed, 02 Mar 2022 16:26:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPVxy-0005x0-N3 for qemu-devel@nongnu.org; Wed, 02 Mar 2022 15:52:59 -0500 Received: from [2a00:1450:4864:20::436] (port=43959 helo=mail-wr1-x436.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPVxw-0000KJ-Oe for qemu-devel@nongnu.org; Wed, 02 Mar 2022 15:52:58 -0500 Received: by mail-wr1-x436.google.com with SMTP id m6so4661565wrr.10 for ; Wed, 02 Mar 2022 12:52:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CZ5TYYnUc0e1hEuIV2ZzXVXaht7eB3zPn5/u5sClZ4M=; b=OscOzPwP9qe7eauvOc3CFg/XInvmSXqzaIDR+fcOWX0L/96Xtn9XOg+mO1ebR70ZNe 6OFuQDSdsO/MbH7x4ZcZuHOxCUDZ77fT6W2jA7nd4HKohmee2ZEAHJvCuYnryvJ+5yut CFWC96qpIb3TDYAC1+qzmQDGqTw/TbJ1/GchBYofIub1XsTwv6sqBUiFXcpSY63qc46z acwanGqrZvh/NsMCuwfegRCXubmDsCVuo3vWNUk7VTwUu6v74VCM2pNYsbRSUWKB4hYx CcxWDv3nwv7B1ulJUP3MHA9OE/O8Ctu8W9CBTlmNUtv1TUh8HrpeEMADATeCjuM8kVom rx5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CZ5TYYnUc0e1hEuIV2ZzXVXaht7eB3zPn5/u5sClZ4M=; b=vPBtc5SlqwaQATz/htTmoDYJ2bIRr7m9TMQfmKql2zD9RL89dhnuCTklkJSe7HaoUd F74H3bCTv6hk+SofP8zseKJhhA2EIgNxaPr153CNHpxhM/RZ9fP5EyvLoEnYrouwSamj xCVgKCRlR89of2Qh5Rc31RcMa4WKeGEbARDpxMF3VwjgpM1weZIQ7Ye5sWtAv0HrXUiN HT7RvC+tr1T2BVBcqlQ8emD4bD3WXVhSdfDld6l1nXOab9xUv20el/dgKPa/nJtUGE6T WqrKhr2ZSWOH0kBeirUe0GUKC8qeItLtsfwlDUFWMzltbf/Wm0zhAWb65pFgaOLuWemW YIdA== X-Gm-Message-State: AOAM533lSn5Fq4RcEnq9mxx1kIzCawtfCO/uMPTV9kD/luivTTvYRlG2 WoLwk/v2TENZFz/Or4sc6+F/RODAyM7GuA== X-Received: by 2002:a5d:64e7:0:b0:1e4:bb8b:d3eb with SMTP id g7-20020a5d64e7000000b001e4bb8bd3ebmr24247776wri.403.1646254375510; Wed, 02 Mar 2022 12:52:55 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id x13-20020adfec0d000000b001e31279cc38sm90801wrn.11.2022.03.02.12.52.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 12:52:55 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/26] ui/cocoa.m: Remove unnecessary NSAutoreleasePools Date: Wed, 2 Mar 2022 20:52:30 +0000 Message-Id: <20220302205230.2122390-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220302205230.2122390-1-peter.maydell@linaro.org> References: <20220302205230.2122390-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::436 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In commit 6e657e64cdc478 in 2013 we added some autorelease pools to deal with complaints from macOS when we made calls into Cocoa from threads that didn't have automatically created autorelease pools. Later on, macOS got stricter about forbidding cross-thread Cocoa calls, and in commit 5588840ff77800e839d8 we restructured the code to avoid them. This left the autorelease pool creation in several functions without any purpose; delete it. We still need the pool in cocoa_refresh() for the clipboard related code which is called directly there. Signed-off-by: Peter Maydell Reviewed-by: Akihiko Odaki Tested-by: Akihiko Odaki Message-id: 20220224101330.967429-3-peter.maydell@linaro.org --- ui/cocoa.m | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 5ed1495552a..b6e70e9134d 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -1976,8 +1976,6 @@ int main (int argc, char **argv) { static void cocoa_update(DisplayChangeListener *dcl, int x, int y, int w, int h) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - COCOA_DEBUG("qemu_cocoa: cocoa_update\n"); dispatch_async(dispatch_get_main_queue(), ^{ @@ -1993,14 +1991,11 @@ static void cocoa_update(DisplayChangeListener *dcl, } [cocoaView setNeedsDisplayInRect:rect]; }); - - [pool release]; } static void cocoa_switch(DisplayChangeListener *dcl, DisplaySurface *surface) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; pixman_image_t *image = surface->image; COCOA_DEBUG("qemu_cocoa: cocoa_switch\n"); @@ -2015,7 +2010,6 @@ static void cocoa_switch(DisplayChangeListener *dcl, [cocoaView updateUIInfo]; [cocoaView switchSurface:image]; }); - [pool release]; } static void cocoa_refresh(DisplayChangeListener *dcl)