|
|
|
This patch will work in 4.0 and 4.1:
==== //depot/apps/diamond/client/framework/pagingdata/pagingdatasetreplicator.lzx#6 - /Users/ptw/OpenLaszlo/ringding-2/diamond/client/framework/pagingdata/pagingdatasetreplicator.lzx ==== --- /tmp/tmp.7554.18 2008-01-06 13:19:44.000000000 -0500 +++ /Users/ptw/OpenLaszlo/ringding-2/diamond/client/framework/pagingdata/pagingdatasetreplicator.lzx 2008-01-06 13:19:40.000000000 -0500 @@ -1,4 +1,4 @@ - <!-- Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. --> + <!-- Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. --> <library> <include href="utils/replicator"/> @@ -97,8 +97,10 @@ } var pp = new LzParsedPath(datapath, this._datapath); + // In 4.1 and later, you must use the accessor to get the path context + var context = ('getContext' in pp) ? pp.getContext(this._datapath) : pp['context']; // Error if we couldn't find pagingdataset. - if ( ! pp['context'] ) { + if ( ! context ) { Debug.error("%w: could not find pagingdataset for datapath '%s'", this, datapath); return; @@ -111,7 +113,7 @@ } // The parsed path context is the paging dataset. - this.pagingDataset = pp.context; + this.pagingDataset = context; this._changePagingData() // register delegates with the new pagingDataset |
||||||||||||||||||||||||||||||||||||||||||||||||||
99a100
> var context = pp.getContext(this._datapath);
101c102
< if ( ! pp['context'] ) {
---
> if ( ! context ) {
114c115
< this.pagingDataset = pp.context;
---
> this.pagingDataset = context;
This is due to a change in 4.1 that fixed several classes of memory leaks:
r6496 | bargull | 2007-09-15 15:47:13 -0400 (Sat, 15 Sep 2007) | 36 lines
Change 20070915-bargull-2 by bargull@dell--p4--2-53 on 2007-09-15 21:39:09
in /home/Admin/src/svn/openlaszlo/branches/legals
for http://svn.openlaszlo.org/openlaszlo/branches/legals
Summary: Fix for memory leak in LzParsedPath
New Features:
Bugs Fixed:
LPP-4214- "LzDatapointer#ppcache" leaks memoryTechnical Reviewer: hminsky
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Added "getContext()" to LzParsedPath which replaces the direct access to "context"-member of "LzParsedPath".
With this change the "context"-member of LzParsedPath is only used for "new"-datasets (xpath:"new:/foo/bar").
This API-Change was necessary, because LzParsedPath was holding a reference to a dataset through his "context"-member,
but even if this dataset was destroyed, the reference was not cleared.
This led to two bugs:
1. it was preventing garbage-collection
2. when a user created a new dataset with the same name, cached LzParsedPaths were still pointing to the old dataset,
which gave some strange errors i.e. when a user used xpath:"ds:/foo/text()" (cached) this gave the old results,
but xpath:"ds:/foo" (non-cached) and then a LzDatapointer#getNodeText() gave new results.
For better understanding of this issue, please see the attached testcase at
LPP-4214.