![]() |
IWCallBackFunc Bug IW 15.1.4 - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: IWCallBackFunc Bug IW 15.1.4 (/thread-1208.html) |
IWCallBackFunc Bug IW 15.1.4 - omarperezh - 08-28-2019 IW is trying to clear an uncreated object, Add Lines commented below //OPH20190826 Prevent Bug unit IWCallBackFunc; //OPH20190826 Prevent Bug interface ... implementation ... procedure TIWCallBacks.Invoke(ACallbackRec: TIWCallbackRec); var LResult: string; LHandled: Boolean; LForm: TIWForm; LSession: TIWApplicationAccess; begin LSession := TIWApplicationAccess(FSession); if not Assigned(LSession) or not Assigned(LSession.ActiveForm) then begin Exit; end; LForm := TIWForm(LSession.ActiveForm); try //Pass a copy of all Request params to the Callback. if not Assigned(FEventParams) then begin FEventParams := TIWStringList.Create; end; FEventParams.AddStrings(LForm.Params, False); if Assigned(ACallbackRec.Method) then begin ACallbackRec.Method(FEventParams); end else if Assigned(ACallbackRec.Proc) then begin LResult := ''; LHandled := False; ACallbackRec.Proc(FEventParams, LResult, LHandled); if LHandled then begin // user code handles the response LSession.CallBackResponse.SendResponse := False; Exit; end; if LResult <> '' then begin // Write result to response as is LSession.CallBackResponse.AddRawText(LResult); end; end; if LForm.SendAJAXNotification then begin LSession.CallBackResponse.AddJavaScriptToExecute(LForm.GetIWAJAXNotificationJSCode); end; finally if Assigned(FEventParams) then //OPH20190826 Prevent Bug FEventParams.Clear; end; end; ... RE: IWCallBackFunc Bug IW 15.1.4 - Alexandre Machado - 08-29-2019 First, thanks for your report but, next time, publish only the part of the code that's related to the problem. IntraWeb code is copyrighted and can't be published. Having said that: I don't think there is a bug there. As you can see, FEventParams object is created if it doesn't exist, in the second line after the try: try //Pass a copy of all Request params to the Callback. if not Assigned(FEventParams) then begin FEventParams := TIWStringList.Create; end; When it gets to the finally block, FEventParams must be assigned. There is no other option. I'm curious to know why you are thinking that this is the culprit of some weird AV you might have been facing... |