• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
WO Finalizer deadlock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WO Finalizer deadlock


  • Subject: WO Finalizer deadlock
  • From: Ramsey Gurley <email@hidden>
  • Date: Sat, 18 Feb 2012 09:18:28 -0700

Hi all,

I've discovered that there is a finalizer deadlock in D2WPage when concurrent request handler is enabled. As a result, D2W pages cannot be garbage collected when its enabled.  The original method looks like

public void finalize() throws Throwable {
D2WContext c = d2wContext();
if (c != null) {
c.pageFinalized();
}
super.finalize();
}

The pageFinalized method on D2WContext just deregisters the context from observing session timeout notifications and then clears the local values.  If I change the method so that it looks like this, everything works fine.

public void finalize() throws Throwable {
D2WContext c = d2wContext();
if (c != null) {
// c.pageFinalized();
NSNotificationCenter.defaultCenter().removeObserver(c);
c._localValues().clear();
}
super.finalize();
}

However, since finalize() is evil, I noticed just commenting out finalize() entirely works equally well.  NSNotificationCenter uses weak references, so it's not going to prevent garbage collection, and the _localValues() will be cleared by the garbage collector.

I'll include the fix in ERDirectToWeb, but I was just wondering... is there any reason why I shouldn't just remove the finalize method?

Thanks,

Ramsey

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: ERD2WCustomQueryBoolean uiStyle
  • Next by Date: Localization & EO Setters
  • Previous by thread: Re: New AjaxFramework and AjaxSortableList bug
  • Next by thread: Localization & EO Setters
  • Index(es):
    • Date
    • Thread