The event works well. When I start or stop a process the event gets fired and my event procedure does his job. However, in one particular situation the app crashes and shows a Access Violation. I've located the origin of the violation, but it does not make sense to me. The problem lies within a cast in the procedure.
When I stop a process, the code below works just fine. However, when I start a process the app crashes after finishing the procedure. The code is very minimalistic, so I think the problem lies within madKernel.
Code: Select all
procedure TListFileHandlesF.ProcessListChange(const list: ICustomBasicList;
const item: IBasic; beforeChange: boolean; changeType: TChangeType;
oldIndex, index: integer);
var
Proc: IProcess;
begin
Proc := item as IProcess;
end;
What am I doing wrong? Or is this a bug in madKernel?