Code Monkey home page Code Monkey logo

Comments (3)

Nambers avatar Nambers commented on May 27, 2024

已实现动态加载dll, 重载很麻烦

from miraicp.

Nambers avatar Nambers commented on May 27, 2024

麻烦的地方主要在卸载,目前的卸载只是从通知列表移除插件,但仍然会占用原有的dll
目前大概发现了几个办法

  1. 使用自定义classLoader反射加载,然后使用完后gc https://web.archive.org/web/20140704120535/http://www.codethesis.com/blog/unload-java-jni-dll
  2. 和mirai-native一样在native部分加载和管理插件

from miraicp.

Nambers avatar Nambers commented on May 27, 2024

目前打算选取一种独特的方式,因为上面的方法

  1. System.gc()并不可靠,只是推荐system进行gc但不能确保
  2. mirai-native那种方法要增加额外的CPP组件

大概在运行的时候先创建/清空一个独特的缓存文件夹,然后把要运行的插件复制进去然后改名运行
如果需要重载的话,就再复制一次然后改名载入,虽然原本的插件无法解除占用,但是可以支持重载了,并且在下一次启动的时候清空就好了

from miraicp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.