Kornalius,
A "new" one ... there getting a little more subtle each time.
Refer to these two "Test" procedures. You can paste them into my "Test Environment" code (overwriting the existing procs of the same name) that I used yesterday for demonstarting memory leaks.
The func that these routines call (GETCSV(aString$,index$)) is below (for completeness ... it is already in the "utils.ppl" file withing my "test environment"
Now if you run Proc#1 you will find it DOES NOT show any memory leaks. Its a tight loop calling GetCSV and assigning the result to a string.
If you run Proc#2 it DOES LEAK MEMORY. It is also a call to GetCSV, with the same parameters, but this time in the context of an if (GetCSv == ?) ... end; context.
Sorry to keep throwing them up, but everyone we solve will help make the final release more stable.
A "new" one ... there getting a little more subtle each time.
Refer to these two "Test" procedures. You can paste them into my "Test Environment" code (overwriting the existing procs of the same name) that I used yesterday for demonstarting memory leaks.
- Code:
proc DoTestProc1(hWnd$, Msg$, wParam$, lParam$)
local (lst$, aString$, bString$);
print("Test Proc #1 (aString$ = GetCSV()) started");
DebugCount$ = TickCount$;
aString$ = "arg1,arg2,arg3 arg4,arg5";
CheckMenu (showMenu$, 1601, true);
while (MenuChecked (showMenu$, 1601))
bString$ = GetCSv(aString$,1);
ProcessMessages;
end;
print("----------------------------------------");
end;
- Code:
proc DoTestProc2(hWnd$, Msg$, wParam$, lParam$)
local (lst$, aString$, bString$);
print("Test Proc #2 (if GetCSV() ...) started");
DebugCount$ = TickCount$;
aString$ = "arg1,arg2,arg3 arg4,arg5";
CheckMenu (showMenu$, 1602, true);
while (MenuChecked (showMenu$, 1602))
if (GetCSv(aString$,1) == "TEST")
bString$ = "abcdef";
end;
ProcessMessages;
end;
print("----------------------------------------");
end;
The func that these routines call (GETCSV(aString$,index$)) is below (for completeness ... it is already in the "utils.ppl" file withing my "test environment"
- Code:
func GetCSV(aString$,index$)
local(lst$);
List(lst$);
StrTolist(aString$,",",lst$);
index$--;
if ((index$ >= 0) & (index$ < count(lst$)))
goto (lst$,index$);
return (str(lst$));
else
return("");
end;
end;
Now if you run Proc#1 you will find it DOES NOT show any memory leaks. Its a tight loop calling GetCSV and assigning the result to a string.
If you run Proc#2 it DOES LEAK MEMORY. It is also a call to GetCSV, with the same parameters, but this time in the context of an if (GetCSv == ?) ... end; context.
Sorry to keep throwing them up, but everyone we solve will help make the final release more stable.