On 2009.09.16., at 10:16, Franček Prijatelj wrote:


Hi Pritpal

In STATIC FUNCTION Dialogs You are using local oDlg which
is overwriten many times (you should delete QWidgets pointed to by it,
before allocating new ones)

One solution (not going in other leaks) is this:


PROCEDURE Main()
  Local oLabel, oBtn, oDA, oTabBar
  Local oWnd, oSize
  Local oMenuBar, pIcon
  Local oMenuA, pAction
  LOCAL oPS, oPPrv, oMB, oWZ, oCD, oWP, oSBar, oStyle
  ****  Add code
  PUBLIC oDlg1:=oDlg2:=oDlg3:=oDlg4:=oDlg5:=oDlg6:=Nil
  *********

Sorry to jump in, but if there is anything else we
can use instead of PUBLICs we should rather try to
do so. For me it looks bad example to use PUBLIC vars
in example code, as I'd surely wouldn't like to copy
that in any sort of production code. Perhaps a local
array could replace it.

The other thing I don't understand is how is it
possible to create leaks merely by using valid
.prg code? Is it possible to solve this problem
so that such thing cannot happen? Is there a manual
way to free these objects?

Brgds,
Viktor

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to