Telegram_2018-11-08T18

<< Click to Display Table of Contents >>

Navigation:  Telegram > 2018 > 11 > 08 >

Telegram_2018-11-08T18

Telegram link

 

2018-11-08T18:10:13

 

I think there is a problem somewhere in your code which causes that

 


 

Telegram link

 

2018-11-08T18:10:26

 

FastMM doesn't have any known bugs like that

 


 

Telegram link

 

2018-11-08T18:10:35

 

the same for IW code

 


 

Telegram link

 

2018-11-08T18:11:24

 

I suggest you to turn off debug info in FastMM4 code (not required but you don't want to debug FastMM code). To do that, check comments in FastMM4.pas file

 


 

Telegram link

 

2018-11-08T18:11:38

 

then try to debug your own code when a session is being destroyed

 


 

Telegram link

 

2018-11-08T18:12:30

 

Maybe you are trying to free something twice. It is a *very* common mistake that can go unoticed even to experienced developers

 


 

Telegram link

 

2018-11-08T18:13:14

 

don't create any new thread on the servercontroller, unless you have a good reason for that.... It is not necessary

 


 

Telegram link

 

2018-11-08T18:14:06

 

I see you have several arrays of controls in your user session

 


 

Telegram link

 

2018-11-08T18:14:20

 

how do you create and destroy them? Who is the owner?

 


 

Telegram link

 

2018-11-08T18:16:21

 

all with \if\ - so, \Maybe you are trying to free something twice\ - disappears?

 


 

Telegram link

 

2018-11-08T18:16:52

 

How can I do this?

 


 

Telegram link

 

2018-11-08T18:18:29

 

open your file type: link FastMM4Options.inc

 


 

Telegram link

 

2018-11-08T18:18:46

 

look for NoDebugInfo

 


 

Telegram link

 

2018-11-08T18:19:05

 

you will find something like:

 

{.$define NoDebugInfo}

 


 

Telegram link

 

2018-11-08T18:19:24

 

the DOT . in front of the dollar sign disables it, right?

 


 

Telegram link

 

2018-11-08T18:19:26

 

remove the dot

 


 

Telegram link

 

2018-11-08T18:19:30

 

so it becomes

 


 

Telegram link

 

2018-11-08T18:19:32

 

{$define NoDebugInfo}

 


 

Telegram link

 

2018-11-08T18:19:36

 

rebuild your app

 


 

Telegram link

 

2018-11-08T18:20:33

 

then debug information for FastMM code will not be generated, so you can step into your code without going through FastMM code

 


 

Telegram link

 

2018-11-08T18:21:17

 

how do you create your labels, for instance, which are referenced in one of those arrays?

 


 

Telegram link

 

2018-11-08T18:21:45

 

All dynamicly

 


 

Telegram link

 

2018-11-08T18:22:12

 

yes, but who is the owner?

 

you probably have something like TIWLabel.Create();

 


 

Telegram link

 

2018-11-08T18:22:14

 

right?

 


 

Telegram link

 

2018-11-08T18:24:51

 

all nil with Parents

 


 

Telegram link

 

2018-11-08T18:25:23

 

ok, so you are responsible for its destruction. You should destroy them with something like:

 


 

Telegram link

 

2018-11-08T18:25:25

 

var

 

i: Integer;

 

LControl: TIWControl;

 

begin

 

for i := Low(SetRFLBL) to High(SetRFLBL) do

 

begin

 

LControl := SetRFLBL[i];

 

if Assigned(LControl) then

 

begin

 

LControl.Free;

 

SetRFLBL[i] := nil;

 

end;

 

end;

 

end;

 


 

Telegram link

 

2018-11-08T18:25:42

 

taking for example your SetRFLBL array which contains TIWLabel instances

 


 

Telegram link

 

2018-11-08T18:27:07

 

First Parent Control depends of IWForm Region

 


 

Telegram link

 

2018-11-08T18:27:32

 

OK... looks correct

 


 

Telegram link

 

2018-11-08T18:27:33

 

Ok, I'll try

 


 

Telegram link

 

2018-11-08T18:28:03

 

the code I wrote above... use it BEFORE changing the array length

 


 

Telegram link

 

2018-11-08T18:28:09

 

or clearing it

 


 

Telegram link

 

2018-11-08T18:29:04

 

do it right after the FileExists() lines above

 


 

Telegram link

 

2018-11-08T18:29:57

 

ye I undarstand, thanks??

 


 

Telegram link

 

2018-11-08T18:30:06

 

??

 


 

Telegram link

 

2018-11-08T18:32:09

 

I'll take an hour - I have already begun to make a thread - I want to see what happens?? ... write off the result - something interesting was done))) Everything that you wrote about then I will do ok??

 


 

Telegram link

 

2018-11-08T18:32:59

 

??

 


 

Telegram link

 

2018-11-08T18:35:17

 

no problem if you need a thread to do something you need, but have in mind that you are creating one thread per session with that code. This comes with a cost

 


 

Telegram link

 

2018-11-08T18:40:12

 

yes, but threads clean memory leaks well - I use a similar approach in my bots and it works fine... I need to use specific thread for IW? Or that's all rigth?

 


 

Telegram link

 

2018-11-08T18:41:12

 

Last time I can't do that because it was AFlag exception

 


 

Telegram link

 

2018-11-08T18:42:09

 

I want to deal with it??

 


 

Telegram link

 

2018-11-08T18:43:34

 

VCL is not thread safe (not talking about IW code, but Delphi VCL code)

 


 

Telegram link

 

2018-11-08T18:43:44

 

creating components in threads is not something you should do

 


 

Telegram link

 

2018-11-08T18:44:30

 

it will always work in your dev environment, with a single user. But will always fail in your prod enviroment, withouth any warning

 


 

Telegram link

 

2018-11-08T18:47:05

 

ok, let me finish the experiment Alexandre??At least I will write how to do it is not necessary??

 


 

Telegram link

 

2018-11-08T18:47:33

 

ok

 


 

Telegram link

 

2018-11-08T18:49:08

 

IW creates their components in threads, but IW code protects itself from concurrent access. <- just a little context

 


 

Telegram link

 

2018-11-08T18:49:58

 

??