Icon View Incident Report

Serious Serious
Reported By: Matthew Jones
Reported On: 3/13/2013
For: Version 1.01 Build 5
# 3787 Directly Calling an Event Handler with No Parameters Causes Compiler Access Violation

I've got a project that causes an access violation during compilation of the following code:

procedure TForm1.OnServerLoginNeeded(aCallBack : TOnSuccessCallback);
begin
    Report('Called back');
    m_pfnLoginRetry := aCallBack;
    DoLogin;
//    aCallBack;
end;

procedure TForm1.OnServerStatusComplete(nResult : Integer; tmDateTime : DateTime; szStatusMessage : String);
begin
    Report('Server Status complete');
    Report(szStatusMessage);
end;

procedure TForm1.OnServerLoginComplete(nResult : Integer);
begin                                      
    Report('Login response ' + IntToStr(nResult));
    if nResult = 1 then
    begin
        if assigned(m_pfnLoginRetry) then
        begin
            Report('Found retry fn');
            m_pfnLoginRetry();  <<<< Causes access violation  !!!
            m_pfnLoginRetry := nil;
            Report('Called retry fn');
        end
        else
        begin
            Report('No retry fn');
        end;
    end
    else
    begin
        Report('Sorry, the account details are not recognised. Please try again.');
    end;
end;



Resolution Resolution
Fixed Problem on 3/13/2013 in version 1.02 build 1


Products Affected Products Affected
Elevate Web Builder
Elevate Web Builder Trial

Image