Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

组件多次渲染销毁,pagView显示失败 #133

Closed
Molfith opened this issue Feb 23, 2022 · 3 comments
Closed

组件多次渲染销毁,pagView显示失败 #133

Molfith opened this issue Feb 23, 2022 · 3 comments
Assignees

Comments

@Molfith
Copy link

Molfith commented Feb 23, 2022

Bug 描述

组件中包含pag时,多次渲染销毁后。pagView.init失败;
组件销毁时pagView.destroy()报错:
message: "Cannot pass deleted object as a pointer of type _PAGPlayer*"
name: "BindingError"
stack: "BindingError: Cannot pass deleted object as a pointer of type _PAGPlayer*\n at BindingError. (http://localhost:3000/node_modules/.vite/libpag.js?v=f9aa5be6:5052:21)

问题

请告诉我们你遇到了什么问题。预期是什么?实际表现是什么?

重现

请说明重现步骤。加载的是什么文件,你的代码是怎么写的,等等。
PAG 素材可以在压缩之后,随这个 Bug 上传。

环境

npm libpag 0.0.5

Demo(可选)

请给一个 Demo 项目,我们可以运行并重现这个问题。

其他(可选)

如果还有其他信息可以帮助我们定位问题,请添加其他内容。

@zenoslin
Copy link
Collaborator

这里是存在两个问题吗?

  • 组件中包含pag时,多次渲染销毁后。pagView.init失败;
  • 组件销毁时pagView.destroy()报错;

多次渲染销毁,是什么行为呢,多次init和多次destroy吗?
是否使用了Web框架,如:React、Vue。可以的话提供更多的信息,有助于我们快速定位问题。

@helloforrestworld
Copy link

helloforrestworld commented Apr 7, 2024

环境:Web
版本:"libpag": "^4.2.84",

我也遇到同样的问题了,我的场景是这样的:

  1. 我在一个虚拟列表使用了pag头像框
  2. 当滑动列表的时候,不可见元素会卸载,从而触发react组件的卸载钩子,钩子里面会调用pagView和pagFile的destroy方法
  3. 来回滑动就会报这个错
    image
    image

@helloforrestworld
Copy link

@zenoslin

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

No branches or pull requests

4 participants