library_path_(path),
xw_extension_(0),
lazy_loading_(false),
+ handle_(nullptr),
delegate_(delegate),
created_instance_callback_(NULL),
destroyed_instance_callback_(NULL),
name_(name),
entry_points_(entry_points),
lazy_loading_(true),
+ handle_(nullptr),
delegate_(delegate),
created_instance_callback_(NULL),
destroyed_instance_callback_(NULL),
if (shutdown_callback_)
shutdown_callback_(xw_extension_);
XWalkExtensionAdapter::GetInstance()->UnregisterExtension(this);
+ dlclose(handle_);
}
bool XWalkExtension::Initialize() {
if (initialized_)
return true;
- void* handle = dlopen(library_path_.c_str(), RTLD_LAZY);
- if (!handle) {
+ handle_ = dlopen(library_path_.c_str(), RTLD_LAZY);
+ if (!handle_) {
LOGGER(ERROR) << "Error loading extension '"
<< library_path_ << "' : " << dlerror();
return false;
}
XW_Initialize_Func initialize = reinterpret_cast<XW_Initialize_Func>(
- dlsym(handle, "XW_Initialize"));
+ dlsym(handle_, "XW_Initialize"));
if (!initialize) {
LOGGER(ERROR) << "Error loading extension '" << library_path_
<< "' : couldn't get XW_Initialize function.";
- dlclose(handle);
+ dlclose(handle_);
return false;
}
if (ret != XW_OK) {
LOGGER(ERROR) << "Error loading extension '" << library_path_
<< "' : XW_Initialize() returned error value.";
- dlclose(handle);
+ dlclose(handle_);
return false;
}