From ab45322dca17ff78ce712f2fc5e8d40a3372e40a Mon Sep 17 00:00:00 2001 From: tianp Date: Mon, 4 Aug 2025 17:30:58 +0800 Subject: [PATCH] =?UTF-8?q?fswatcher=E6=8E=A5=E5=8F=A3=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tianp Change-Id: I404ab086a5b9d564f26a9497386c0132f6585aa0 --- .../js/src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/interfaces/kits/js/src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp b/interfaces/kits/js/src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp index 79d6fb1dc..f5c744b5f 100644 --- a/interfaces/kits/js/src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp +++ b/interfaces/kits/js/src/mod_fs/class_watcher/ani/fs_watcher_wrapper.cpp @@ -45,12 +45,14 @@ ani_object FsWatcherWrapper::Wrap(ani_env *env, const FsWatcher *watcher) HILOGE("FsWatcher pointer is null!"); return nullptr; } + auto classDesc = FS::WatcherInner::classDesc.c_str(); ani_class cls; if (ANI_OK != env->FindClass(classDesc, &cls)) { HILOGE("Cannot find class %s", classDesc); return nullptr; } + auto ctorDesc = FS::WatcherInner::ctorDesc.c_str(); auto ctorSig = FS::WatcherInner::ctorSig.c_str(); ani_method ctor; @@ -58,7 +60,8 @@ ani_object FsWatcherWrapper::Wrap(ani_env *env, const FsWatcher *watcher) HILOGE("Cannot find constructor method for class %s", classDesc); return nullptr; } - ani_long ptr = static_cast(reinterpret_cast(watcher)); + + ani_long ptr = static_cast(reinterpret_cast(watcher)); ani_object obj; if (ANI_OK != env->Object_New(cls, ctor, &obj, ptr)) { HILOGE("New %s obj Failed!", classDesc); -- Gitee