Return-Path: X-Original-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 41C959E2D for ; Tue, 7 Feb 2012 20:45:07 +0000 (UTC) Received: (qmail 48159 invoked by uid 500); 7 Feb 2012 20:45:06 -0000 Delivered-To: apmail-incubator-flex-dev-archive@incubator.apache.org Received: (qmail 48107 invoked by uid 500); 7 Feb 2012 20:45:06 -0000 Mailing-List: contact flex-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-dev@incubator.apache.org Received: (qmail 48099 invoked by uid 99); 7 Feb 2012 20:45:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 20:45:06 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [80.237.132.80] (HELO wp073.webpack.hosteurope.de) (80.237.132.80) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 20:44:58 +0000 Received: from p4aa831.osaknt01.ap.so-net.ne.jp ([120.74.168.49] helo=[192.168.1.21]); authenticated by wp073.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) id 1Ruru0-0004Za-Pi; Tue, 07 Feb 2012 21:44:37 +0100 Message-ID: <4F318D2D.6080304@leichtgewicht.at> Date: Wed, 08 Feb 2012 05:44:30 +0900 From: Martin Heidegger User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: flex-dev@incubator.apache.org Subject: Re: JavaScript VS. Weak references References: <4F317C93.6070005@leichtgewicht.at> <4F31881D.1040708@leichtgewicht.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;mh@leichtgewicht.at;1328647498;0bb3798c; On 08/02/2012 05:36, Maciek Sakrejda wrote: > How so?... My very tired brain pictures a implementation like: class EventDispatcher { private var _listeners: Object = {}; public function addEventListener(event: String, listener: Function) { if((_listeners[event] ||= []).indexOf(listener) == -1) { _listeners[event].push(listener); } } } Then we have the instance referencing to a object referencing to a array referencing to the original instance creating a big cyclic reference. I am pretty sure that this should resolve itself once there is no reference anymore to that instance but somewhere in my mind I had a thought why this would be a problem. Ah, I guess I should go to bed, gn8 Martin.