Quantcast
Channel: Delphi – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 1445

multithreading – Closure in TTask.Run(AnonProc) not released after AnonProc has finished – Stack Overflow

$
0
0

For my link archive: [WayBackmultithreading – Closure in TTask.Run(AnonProc) not released after AnonProc has finished – Stack Overflow

via: [WayBackHow the combination of inline, interfaces and missing RVO can break your code – Stefan Glienke – Google+

TL;DR from RAD StudioRSP-12462 TThreadPool worker thread holds reference to last executed task by Asbjørn Heid as a regression since XE8:

A temporary variable in TThreadPool.TQueueWorkerThread.Execute keeps a reference to the last executed work-item (task), which is only released when the Execute method ends.

Being in a pool the thread is usually kept alive until the pool is destroyed, which for the Default pool means during finalization of the unit. Thus the last executed tasks are not released until the program terminates.

–jeroen


Viewing all articles
Browse latest Browse all 1445

Trending Articles