Skip to content

a single instance and header improve#1

Open
iomeone wants to merge 3 commits intowang70937:masterfrom
iomeone:fix
Open

a single instance and header improve#1
iomeone wants to merge 3 commits intowang70937:masterfrom
iomeone:fix

Conversation

@iomeone
Copy link
Copy Markdown

@iomeone iomeone commented Aug 15, 2019

CJsModule* CJsModule::GetInstance()
{

	static CJsModule js;
	return &js;
}

CJsModule js; this variable should be static ? because otherwise it will be freed when leave the function?

and a header file path improve ~

var vRet = curl.post("192.168.35.99", "http://192.168.35.99:3000/queryMsg/query", "_trunc=-1&_limit=10", 0, 1);
//parse
var vRoot = json.parse(vRet);
//IsValid
if(vRoot.IsValid())   can cause crash when 192.168.35.99 is unreachable.
so we need check  v as follows in json.cpp
			v8::Handle<v8::Value> v = v8pp::json_parse(m_isolate, m_str);
			if (v.IsEmpty())
				return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant