Kbase P164683: GET-PARENT method of x-noderef object does not return ? when called on the root node
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  20/09/2010 |
|
Status: Unverified
SYMPTOM(s):
Get-parent method of x-noderef object does not return ? when called on the root node
The object behind the hNodeRef handle becomes corrupted
When accessing hNodeRef:OWNER-DOCUMENT, the client crashes with a memory violation
Protrace reads:
proNodeExecute
DllStartup
FACT(s) (Environment):
The problem is not observed on 10.1B03 or prior
The problem is observed with 10.1C or later
Windows
OpenEdge 10.1C
OpenEdge 10.2x
CAUSE:
Bug# OE00197209
FIX:
Upgrade to 10.2B02 or later.
As a workaround, replace any hNode1:GET-PARENT(hNode2) calls with xml_SafeGetParent(hNode1,hNode2):
FUNCTION xml_SafeGetParent RETURNS LOGICAL (INPUT iphStartNodeRef AS HANDLE, INPUT iphParentNodeRef AS HANDLE):
/* Safe wrapper for get-parent() to make it behave as the documentation says that it should.
Progress bug ref:OE00197209 means that get-parent() doesn't return ? when it is called on the root node
This bug also corrupts the node behind the noderef so that it can look like it is OK but in fact has lost its connection to
the x-document. - This can cause a later client crash in 10.1C+ */
DEFINE VARIABLE hRoot AS HANDLE NO-UNDO.
DEFINE VARIABLE lOK AS LOGICAL NO-UNDO.
CREATE WIDGET-POOL.
CREATE X-NODEREF hRoot.
iphStartNodeRef:OWNER-DOCUMENT:GET-DOCUMENT-ELEMENT(hRoot).
IF (hRoot:UNIQUE-ID = iphStartNodeRef:UNIQUE-ID) THEN
RETURN ?.
ELSE DO:
lOK = iphStartNodeRef:GET-PARENT(iphParentNodeRef) NO-ERROR.
RETURN lOK.
END.
END FUNCTION.