How is Chromium component (Delphi) dynamically created?

How to destroy a dynamically created Tchromium component? I use a DLL, a component needed to create and destroy it several times without freeing the DLL, the problem is that the memory is not freed and the cache folder cannot be cleared. If I use CefShutDown issues, it will eventually need to re-create the browser. I am using the latest DCEF3. Create dynamically like this:

crm := TChromium.Create(Form1);
crm.SetParentComponent (Panel2);
crm.Align := alClient;

      

to destroy the attempt in several ways:

FreeAndNil(crm);
crm.free;
crm := nil;
CefShutDown;

      

CefShutDown decided to destroy in time, the problem occurs by the time I try to recreate the component again without freeing my DLL.

Also solve another problem I faced with UserAgent cannot change browser rest.

I appreciate any suggestions to solve my problem.

+3


source to share


1 answer


This behavior is also designed. Issue 1237 in the chrome issue tracker is identical to your issue. Relevant excerpt:

CefInitialize / CefShutdown cannot be called multiple times in the same process. You can create / destroy multiple browser windows without CEF reinitialization.



You will have to refrain from calling CefShutDown

.

+6


source







All Articles