Recent

Author Topic: Whats wrong with this code ??  (Read 3498 times)

BSaidus

  • Hero Member
  • *****
  • Posts: 545
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Whats wrong with this code ??
« on: December 15, 2021, 02:26:48 pm »
Hello,
I use : lazarus 2.0.12 with fpc 322 on Windows, to create application with the mORMot RemoteDB.
Here is s Simple mORmot exemple to test.
In the project there is two(2) buttons and in the build options, I included heaptrc option.
Before Starting, make sure that the instance of the server is shutdown.
When you start a project & click the button "connect", an exception will raised. and when you close application, there will be a memory leak reported by heaptrc.

Help needed:)

« Last Edit: December 15, 2021, 02:29:19 pm by BSaidus »
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

Bi0T1N

  • Jr. Member
  • **
  • Posts: 85
Re: Whats wrong with this code ??
« Reply #1 on: December 15, 2021, 10:05:47 pm »
Just by scrolling through your code it seems to me that the name of the database differs between server and client:
Code: Pascal  [Select][+][-]
  1. LCnt := TSQLDBWinHTTPConnectionProperties.Create( '127.0.0.1:7443' , 'mediq1', 'user' , 'pass' );
vs.
Code: Pascal  [Select][+][-]
  1. fcg.db     := fIni.ReadString('ConnHttp','db','medik1');
  2. ...
  3. fHttpConnection := TSQLDBServerRemote.Create( fDBConnection, fcg.db, host, fcg.user, fcg.pass ); //TSQLDBServerHttpApi.Create( fDBConnection, 'medic1', edtIPPort.Text, 'user','pass' );

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: Whats wrong with this code ??
« Reply #2 on: December 15, 2021, 10:11:35 pm »
Well spotted :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

BSaidus

  • Hero Member
  • *****
  • Posts: 545
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: Whats wrong with this code ??
« Reply #3 on: December 16, 2021, 07:41:46 am »
Just by scrolling through your code it seems to me that the name of the database differs between server and client:


Yes, I did that to test if the connection will not established.
The memory leak happen when there is no connection, du for some problème.
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

 

TinyPortal © 2005-2018