mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
Signed-off-by: zhongjianfei <zhongjianfei@huawei.com> Change-Id: I0def4bfc7a2d7c0e3369a02b6c43077ff0db135f
This commit is contained in:
parent
21d9600da4
commit
19567aa233
@ -40,6 +40,15 @@ FlutterWindow::FlutterWindow(int32_t instanceId) : instanceId_(instanceId) {}
|
||||
|
||||
FlutterWindow::~FlutterWindow() {}
|
||||
|
||||
void FlutterWindow::Destroy()
|
||||
{
|
||||
auto window = flutter::WindowManager::GetWindow(instanceId_);
|
||||
if (window != nullptr) {
|
||||
window->SetBeginFrameCallback(nullptr);
|
||||
}
|
||||
vsyncCallbacks_.clear();
|
||||
}
|
||||
|
||||
void FlutterWindow::RequestFrame()
|
||||
{
|
||||
auto window = flutter::WindowManager::GetWindow(instanceId_);
|
||||
|
@ -28,6 +28,8 @@ public:
|
||||
explicit FlutterWindow(int32_t instanceId);
|
||||
~FlutterWindow() override;
|
||||
|
||||
void Destroy() override;
|
||||
|
||||
// Platform window interface
|
||||
void RequestFrame() override;
|
||||
void RegisterVsyncCallback(AceVsyncCallback&& callback) override;
|
||||
|
@ -61,7 +61,9 @@ void FlutterWindow::SetRootRenderNode(const RefPtr<RenderNode>& root) {}
|
||||
void FlutterWindow::OnVsyncCallback(uint64_t timeStampNanos)
|
||||
{
|
||||
for (const auto& vsyncCallback : vsyncCallbacks_) {
|
||||
vsyncCallback(timeStampNanos, 0);
|
||||
if (vsyncCallback) {
|
||||
vsyncCallback(timeStampNanos, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,9 @@ QJSDeclarativeEngine::~QJSDeclarativeEngine()
|
||||
delete nativeEngine_;
|
||||
}
|
||||
#endif
|
||||
JS_RunGC(engineInstance_->GetQJSRuntime());
|
||||
if (engineInstance_ && engineInstance_->GetQJSRuntime()) {
|
||||
JS_RunGC(engineInstance_->GetQJSRuntime());
|
||||
}
|
||||
}
|
||||
|
||||
bool QJSDeclarativeEngine::Initialize(const RefPtr<FrontendDelegate>& delegate)
|
||||
|
@ -3062,8 +3062,9 @@ QjsEngine::~QjsEngine()
|
||||
nativeEngine_->CancelCheckUVLoop();
|
||||
delete nativeEngine_;
|
||||
}
|
||||
ACE_DCHECK(engineInstance_);
|
||||
JS_RunGC(engineInstance_->GetQjsRuntime());
|
||||
if (engineInstance_ && engineInstance_->GetQjsRuntime()) {
|
||||
JS_RunGC(engineInstance_->GetQjsRuntime());
|
||||
}
|
||||
}
|
||||
|
||||
void QjsEngine::GetLoadOptions(std::string& optionStr, bool isMainPage, const RefPtr<JsAcePage>& page)
|
||||
|
@ -405,8 +405,9 @@ QjsPaEngine::~QjsPaEngine()
|
||||
if (nativeEngine_ != nullptr) {
|
||||
delete nativeEngine_;
|
||||
}
|
||||
ACE_DCHECK(engineInstance_);
|
||||
JS_RunGC(engineInstance_->GetQjsRuntime());
|
||||
if (engineInstance_ && engineInstance_->GetQjsRuntime()) {
|
||||
JS_RunGC(engineInstance_->GetQjsRuntime());
|
||||
}
|
||||
}
|
||||
|
||||
inline int32_t GetJsInt32Val(JSContext* ctx, JSValueConst value)
|
||||
|
@ -36,6 +36,8 @@ public:
|
||||
|
||||
static std::unique_ptr<PlatformWindow> Create(AceView* aceView);
|
||||
|
||||
virtual void Destroy() {};
|
||||
|
||||
// Request next vsync.
|
||||
virtual void RequestFrame() = 0;
|
||||
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
|
||||
void Destroy()
|
||||
{
|
||||
platformWindow_->Destroy();
|
||||
platformWindow_.reset();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user