// static
void XWalkModuleSystem::ResetModuleSystemFromContext(
v8::Handle<v8::Context> context) {
- delete GetModuleSystemFromContext(context);
- SetModuleSystemInContext(std::unique_ptr<XWalkModuleSystem>(), context);
+ XWalkModuleSystem* module_system = GetModuleSystemFromContext(context);
+ if (module_system) {
+ delete module_system;
+ SetModuleSystemInContext(std::unique_ptr<XWalkModuleSystem>(), context);
+ }
}
void XWalkModuleSystem::RegisterExtensionModule(
#include "common/profiler.h"
#include "extensions/renderer/runtime_ipc_client.h"
#include "extensions/renderer/xwalk_extension_renderer_controller.h"
+#include "extensions/renderer/xwalk_module_system.h"
#include "extensions/renderer/widget_module.h"
namespace runtime {
const char* /*theme*/,
const char* base_url) {
SCOPE_PROFILE();
+
+ // Initialize context's aligned pointer in embedder data with null
+ extensions::XWalkModuleSystem::SetModuleSystemInContext(
+ std::unique_ptr<extensions::XWalkModuleSystem>(), context);
+
LOGGER(DEBUG) << "InjectedBundle::DynamicPluginStartSession !!" << tizen_id;
if (base_url == NULL || common::utils::StartsWith(base_url, "http")) {
LOGGER(ERROR) << "External url not allowed plugin loading.";