5

I just upgraded my V8 version to 3.20.16 (from some very old version). I can no longer use

Handle<Object> obj /* = ... */;
Persistent<Object> p = Persistent<Object>::New( obj );

to create a persistent handle to an object. The compiler suggests using static T* v8::Persistent<T>::New(v8::Isolate*, T*) [with T = v8::Object] instead. However, if I change my code to

Handle<Object> obj /* = ... */;
Persistent<Object> p = Persistent<Object>::New( Isolate::GetCurrent(), *obj );

the compiler complains that this function is private. How do I create a Persistent<Object> handle from a normal Handle<Object> now?

I've googled and the only thing I found was that the documentations seem to contradict each other:

thanks for any help in advance


How to stop logcat messages

I occasionally the following scenario when trying to debug my multi-threaded app. I run the program and then a bug occurs causing a useful message to appear in the log cat... but only for about a quarter of a second before scrolling off the top of the window because a seemingly never-ending stream of of not-so useful error messages floods into the window. I am then left desperately trying to grab the vertical scroll bar (which is now jiggling around) so as to position the original error message into the window before the window buffer becomes so full that it is discarded.

There must be a better way... Is there a "stop-logging-now" command/button that I can hit as soon as the errors start appearing?

4

1 回答 1

4

有一个接受正常的构造函数Handle<T>,您不需要取消引用它。

Persistent<Object>::New(Isolate::GetCurrent(), obj)

应该管用。

于 2013-08-20T15:14:40.983 回答