Return-Path: X-Original-To: apmail-flex-users-archive@www.apache.org Delivered-To: apmail-flex-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 34ADE10238 for ; Thu, 6 Jun 2013 16:03:30 +0000 (UTC) Received: (qmail 36783 invoked by uid 500); 6 Jun 2013 16:03:29 -0000 Delivered-To: apmail-flex-users-archive@flex.apache.org Received: (qmail 36737 invoked by uid 500); 6 Jun 2013 16:03:29 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Received: (qmail 36729 invoked by uid 99); 6 Jun 2013 16:03:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 16:03:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of modjklist@comcast.net designates 76.96.27.227 as permitted sender) Received: from [76.96.27.227] (HELO qmta12.emeryville.ca.mail.comcast.net) (76.96.27.227) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 16:03:21 +0000 Received: from omta03.emeryville.ca.mail.comcast.net ([76.96.30.27]) by qmta12.emeryville.ca.mail.comcast.net with comcast id l0vW1l0030b6N6401430eV; Thu, 06 Jun 2013 16:03:00 +0000 Received: from sz0109.ev.mail.comcast.net ([76.96.40.137]) by omta03.emeryville.ca.mail.comcast.net with comcast id l4301l00j2xZMJ48P430EE; Thu, 06 Jun 2013 16:03:00 +0000 Date: Thu, 6 Jun 2013 16:03:00 +0000 (UTC) From: modjklist@comcast.net To: users@flex.apache.org Message-ID: <1584136569.51277.1370534580423.JavaMail.root@sz0109a.emeryville.ca.mail.comcast.net> In-Reply-To: <1832661126.50692.1370533925188.JavaMail.root@sz0109a.emeryville.ca.mail.comcast.net> Subject: Re: when to dispose of objects for garbage collection? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [::ffff:76.126.116.163] X-Mailer: Zimbra 6.0.13_GA_2944 (ZimbraWebClient - SAF3 (Mac)/6.0.13_GA_2944) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1370534580; bh=NkiEpMrZJ4uxdRZEOFGFxpxaSSY9E6dZIi2xNtuWsWM=; h=Received:Received:Date:From:To:Message-ID:Subject:MIME-Version: Content-Type; b=Qr0VCXbj6kSy73Vuxiu9BqA6URRGhw5dZluIKhV4Vm8GYUXbWxcs4qBn4cPbgcu0t zdFlZH1rShrSHcVJcQ73t91XzFJa97jP/i4cwod8WKpmsn8aUuMvQTqm1vWFR6a86T eZO4DPBhY8/UazIOKZ1+Zc3k1jF8swkqoINWdkZvlJ4uK/VdDDLDi9XeQw66Gq2Z2/ +TSrsg9wXRmng4u4rvNO30sv2T0MzimkVB53yypA4N/DNWSUXan+NOVocSrEAra+I/ Iy15wQ0+WdnA/0RrdSBt5+tsEQZY/UTH1B4hRVZNuevGyNB8DgEasiRfoblJ0iwZuR OTg3RZgoVTgWQ== X-Virus-Checked: Checked by ClamAV on apache.org I should have mentioned regarding question 2 and 3, that the DataGrid, ComboBox, etc., used by the TitleWindow was CREATED in the TitleWindow, and is not used external to the TitleWindow. The questions being whether the TitleWindow automatically cleans up these variables for GC, or requires me to null them first... ----- Original Message ----- From: modjklist@comcast.net To: users@flex.apache.org Sent: Thursday, June 6, 2013 8:52:05 AM Subject: when to dispose of objects for garbage collection? Can someone help me identify when I need to dispose of an object, array, etc. in a typical Flex app? For example, suppose I have an app with several states and a TitleWindow. I know that if I declare a variable for a state, such as: that when I no longer need this array (or object, etc.), I should set it to null to inform the garbage collector (GC) it's ready to be picked up. That's because, otherwise, this variable remains in memory, since the state persists throughout the life of the app. But what if this state uses the following function: QUESTION 1: Do I need to manually null variable myArr2 at the end of function myFunc()? Or, will it be picked up automatically by the GC? How about TitleWindows? QUESTION 2: If I open a TitleWindow (e.g. popup) that contains a DataGrid, do I need to manually null its data provider when I close the TitleWindow? Or, will it be picked up automatically by the GC? QUESTION 3: This last question also applies to a data provider for ComboBox, or an ArrayList, or an Array that is used in a TitleWindow -- do I need to null those as well upon closing the window? Or, will they be picked up automatically by the GC? Thanks in advance for any comments.