Page 1 of 1

Unrecoverable error 9009

Posted: Tue Sep 30, 2008 9:35 pm
by Riccardo
Hello,
in our large application after a lot of open and close xBrowse, we have this error: "Unrecoverable error 9009 hb_xrealloc can't reallocate memory"
I send a little example that after about 20 cicles the error appears.
Thank you

Code: Select all

#include "Fivewin.ch"

PROC Main()
   LOCAL oWnd
   DEFINE WINDOW oWnd TITLE "Test TXBrowse with array"
   @ 100,100 BUTTON "Test" SIZE 100,20 PIXEL OF oWnd ACTION ( TestXBrowse() )
   ACTIVATE WINDOW oWnd
RETURN

FUNC TestXBrowse()
   LOCAL aArray   := Array(1,1)
   LOCAL n
   LOCAL oBrw1, oBrw2, oBrw3, oBrw4, oDlg

   aArray[1]   := Array(100)
   FOR n := 1 TO Len(aArray[1])
      aArray[1,n] := Str(n)
   NEXT

   FOR n:=1 TO 25
      DEFINE DIALOG oDlg SIZE 400,400 TITLE "Cicle n."+Str(n,3)

      oBrw1 := TXBrowse():New(oDlg)
      oBrw1:nTop     := 0
      oBrw1:nLeft    := 0
      oBrw1:nBottom  := 100
      oBrw1:nRight   := 100
      oBrw1:SetArray(aArray)
      oBrw1:CreateFromCode()

      oBrw2 := TXBrowse():New(oDlg)
      oBrw2:nTop     := 0
      oBrw2:nLeft    := 101
      oBrw2:nBottom  := 100
      oBrw2:nRight   := 201
      oBrw2:SetArray(aArray)
      oBrw2:CreateFromCode()

      oBrw3 := TXBrowse():New(oDlg)
      oBrw3:nTop     := 101
      oBrw3:nLeft    := 0
      oBrw3:nBottom  := 201
      oBrw3:nRight   := 100
      oBrw3:SetArray(aArray)
      oBrw3:CreateFromCode()

      oBrw4 := TXBrowse():New(oDlg)
      oBrw4:nTop     := 101
      oBrw4:nLeft    := 101
      oBrw4:nBottom  := 201
      oBrw4:nRight   := 201
      oBrw4:SetArray(aArray)
      oBrw4:CreateFromCode()

      ACTIVATE DIALOG oDlg CENTER
      oDlg:End()
   NEXT
RETURN

Posted: Tue Sep 30, 2008 10:45 pm
by Antonio Linares
Riccardo,

Please add this code to your main PRG and to your example:

Code: Select all

function PalBmpFree( h )
return DeleteObject( h )
There is a problem with PalBmpFree() that we have to fix.

Many thanks for your feedback :-)