#1 2012-09-26 09:21:19

h.hasenack
Member
From: Nijmegen, Netherlands
Registered: 2012-08-01
Posts: 173
Website

Window handle not released, bug fix request

I am currently creating a unit test for the TSQLRestClientURIMessage and found that the window handle created does not get destroyed/closed.
this causes in the unit test as creatring a new named window handle fails because of the pre-existing named window handle.

I suggest following change in SYnCOmmons.pas:

A patch is required to ensure the client window handle is remembered even when the server window is not found:

constructor TSQLRestClientURIMessage.Create(aModel: TSQLModel;
  const ServerWindowName: string; ClientWindow: HWND; TimeOutMS: cardinal);
begin
  inherited Create(aModel);
  fClientWindow := ClientWindow; // HHPatch moved to top
  fServerWindow := FindWindow(pointer(ServerWindowName),nil);
  if fServerWindow=0 then
    raise ECommunicationException.CreateFmt('No "%s" window available - server may be down',
      [ServerWindowName]);
//  fClientWindow := ClientWindow; // HHPatch Moved to top
  fTimeOutMS := TimeOutMS;
end;

Last edited by h.hasenack (2012-09-26 09:32:24)

Offline

#2 2012-09-26 09:55:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Window handle not released, bug fix request

Fix potential GDI handle resource leak in TSQLRestClientURIMessage.Create has been applied.

See http://synopse.info/fossil/info/7b99e0bee1

Thanks for the report.

Offline

Board footer

Powered by FluxBB