I create an instance of CefStringVisitor like this, which also gets a pointer to the class object.
- Code: Select all
GetMainFrame()->GetSource( new MyCefStringVisitor( this ));
The Visit function of MyCefStringVisitor uses "this" to call a function.
Now if I close the application in between, there is a crash, because the "this" object goes out of scope before MyCefStringVisitor::Visit is done.
How do I fix this ? What am I doing wrong ?
In the destructor of the "this" object I am calling CloseBrowser(true).
Is there a way to stop all CefStringVisitor activity before calling CloseBrowser ?