Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions v8js_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ static bool v8js_ini_string(char **field, const zend_string *new_value)/* {{{ */
bool immutable = false;

#ifdef ZTS
v8js_process_globals.lock.lock();
std::lock_guard<std::mutex> lock(v8js_process_globals.lock);

if(v8js_process_globals.v8_initialized) {
v8js_process_globals.lock.unlock();
immutable = true;
}

v8js_process_globals.lock.unlock();
#else
immutable = V8JSG(v8_initialized);
#endif
Expand All @@ -61,11 +58,9 @@ static bool v8js_ini_string(char **field, const zend_string *new_value)/* {{{ */
*field = NULL;
}

if (!ZSTR_VAL(new_value)[0]) {
return SUCCESS;
if (ZSTR_VAL(new_value)[0]) {
*field = zend_strndup(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
}

*field = zend_strndup(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
}

return SUCCESS;
Expand Down