I have a global object, of some custom class, that I have created. It is initialized in main, before CEF.
I use this global in my code - everything is working good. But, when I try using this global in a JS extension - it crushes (the pointer does not exists there).
For example:
- Code: Select all
// Our global object
extern CustomClass* g_var;
CefRefPtr<CefV8Value> get_size(const CefV8ValueList& arguments) {
return CefV8Value::CreateInt(g_var->size());
}
The program crashes here. If I use a global object, without pointers, it is creating a new object and uses the new one instead of the global one...
If I use primitive globals - everything works...
What is the problem?
Thanks!