From mime4j-dev-return-1825-apmail-james-mime4j-dev-archive=james.apache.org@james.apache.org Sat Jan 14 12:31:00 2012 Return-Path: X-Original-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Delivered-To: apmail-james-mime4j-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 32FB9BCA8 for ; Sat, 14 Jan 2012 12:31:00 +0000 (UTC) Received: (qmail 41976 invoked by uid 500); 14 Jan 2012 12:31:00 -0000 Delivered-To: apmail-james-mime4j-dev-archive@james.apache.org Received: (qmail 41909 invoked by uid 500); 14 Jan 2012 12:30:59 -0000 Mailing-List: contact mime4j-dev-help@james.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mime4j-dev@james.apache.org Delivered-To: mailing list mime4j-dev@james.apache.org Received: (qmail 41901 invoked by uid 99); 14 Jan 2012 12:30:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jan 2012 12:30:59 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [217.150.250.48] (HELO kalnich.nine.ch) (217.150.250.48) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jan 2012 12:30:49 +0000 Received: from [192.168.1.110] (77-57-197-206.dclient.hispeed.ch [77.57.197.206]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by kalnich.nine.ch (Postfix) with ESMTPSA id AB335B8235C for ; Sat, 14 Jan 2012 13:30:28 +0100 (CET) Message-ID: <1326544229.19014.16.camel@ubuntu> Subject: Re: Message.dispose() From: Oleg Kalnichevski To: mime4j-dev@james.apache.org Date: Sat, 14 Jan 2012 13:30:29 +0100 In-Reply-To: <282824B0DC715C4A91FDBB715D32723F045212FBB7@AUSX7MCPC103.AMER.DELL.COM> References: <282824B0DC715C4A91FDBB715D32723F045212FBB7@AUSX7MCPC103.AMER.DELL.COM> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.1- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org On Thu, 2012-01-12 at 14:42 -0600, Robert_E_Lee@Dell.com wrote: > After reading the comments in MIME4J-72, it is still unclear how this ended up being implemented, and what users of the API need to do to clean up resources. > > So my question is: Do I need to manually traverse the message and dispose of every disposable object in the message, or only call dispose on the outermost message object itself? Another words, if I call Message.dispose(), does that recursively clean up all of its constituent objects, or must I do that? > > Thanks, > Rob L > > Robert Lee > Software Engineer > Dell | Services Product Group > > 2401 Greenlawn Blvd. > Mailstop RR 7 - 29 > Round Rock, TX 78682 > > Direct: (512) 513-5916 > Since no one else responded so far, here's my take. Message#dispose must also ensure deallocation of resources held by child objects. So, effectively parent is expected to traverse its children and invoke #dispose method on objects being traversed. If this is not the case, please raise a JIRA for the defect. Oleg