OK, further developments on this problem:
I have (exhaustively) reduced this program, eliminating functions, and watching the memory usage. I fully expected that I would remove some block of code or other and the leak would stop. Then I would find my mistake. But the leak did not stop.
Below is a forty-something line program that is, I believe, about as short as it can be and still do a callback dialog with timer. It exhibits the memory leak. According to my inexpert calculations, it leaks around 15 bytes per timer event.
I use a program called DebugView
http://technet.microsoft.com/en-us/sysinternals/bb896647 to display my results using the
DebugData statement, but you can replace that line with a
Message statement to get the same results.
Question: what am I doing wrong?
-Kirby
Tick = 100 ; timer tick interval in milliseconds
memory = "" ; last memory status
#definesubroutine dlgcb(DH, DE, DC, undef1, Dextra)
switch 1
case DE == 0
DialogProcOptions(DH,1,Tick) ; timer ticks in milliseconds
DialogProcOptions(DH,2,@TRUE) ; accept push button
case DE == 1
z = intcontrol(77,0,0,0,0):'/':intcontrol(77,10,0,0,0):'/':intcontrol(77,30,0,0,0):'/':intcontrol(77,60,0,0,0)
if z != memory
DebugData('',"dbg: str/var/bb/com:": z )
memory = z
endif
break
case DE == 2
return 1
endswitch
return -1
#endsubroutine
MyDialogFormat=`WWWDLGED,6.2`
MyDialogCaption=`Menu`
MyDialogX=013
MyDialogY=066
MyDialogWidth=200
MyDialogHeight=355
MyDialogMinWidth=100
MyDialogMinHeight=200
MyDialogNumControls=002
MyDialogProcedure=`dlgcb`
MyDialogFont=`Microsoft Sans Serif|8192|40|34`
MyDialogTextColor=`0|0|0`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=2
MyDialog001=`003,001,192,012,STATICTEXT,"st",DEFAULT,"Sales Menu",DEFAULT,20,1024,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`027,023,036,012,PUSHBUTTON,"push",DEFAULT,"OK",1,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("MyDialog",1)
EXIT