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

最新的代码有内存泄漏 #862

Open
Richard-yhy opened this issue Jun 4, 2020 · 1 comment
Open

最新的代码有内存泄漏 #862

Richard-yhy opened this issue Jun 4, 2020 · 1 comment

Comments

@Richard-yhy
Copy link

static id genCallbackBlock(JSValue *jsVal){

const char *fs = [funcSignature UTF8String];
char *s = malloc(strlen(fs));
strcpy(s, fs);
*signature = s;

master分支代码
这个方法最后分配了内存没有地方释放

@gopep9
Copy link

gopep9 commented Jul 13, 2020

本来就有泄露吧,要新增一个block类型也很难知道这个block什么时候释放,感觉可以用一个全局的Dictionary来保存这堆新增出来的签名,起码相同类型的block不会再产生多个签名字符串。不过也有可能系统会自己释放这个内存?

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

2 participants