Skip to content

Plugin API onunload not being called #8277

Closed
@frostime

Description

@frostime
Contributor

插件 API onunload 没有被调用

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

plugin 的 onunload hook 没有被调用,导致一些资源没有被释放。

Expected result

正常调用

Screenshot or screen recording presentation

No response

Version environment

- Version: 2.8.8
- Operating System: win10
- Browser (if used): 无

Log file

More information

No response

Activity

Vanessa219

Vanessa219 commented on May 16, 2023

@Vanessa219
Member

目前还没想好调用时机,是在卸载或禁用的时候,亦或是其他时候?

frostime

frostime commented on May 16, 2023

@frostime
ContributorAuthor

应该是禁用的时候,卸载应该另外提供别的接口。

以我的为例,我的插件有部分功能需要监听 DOM 的变化,必须才在禁用的时候手动把监听器释放掉。

至于卸载的接口,可以后面在额外加。

changed the title [-]插件 API onunload 没有被调用[/-] [+]Plugin API `onunload` not being called[/+] on May 17, 2023
added this to the 2.8.9 milestone on May 17, 2023
Vanessa219

Vanessa219 commented on May 17, 2023

@Vanessa219
Member

卸载的时候也是先需要先禁用再移除,那我就先加在这两个地方吧。

added a commit that references this issue on May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Vanessa219@frostime

      Issue actions

        Plugin API `onunload` not being called · Issue #8277 · siyuan-note/siyuan