libevent
最近用libevent 写了个http的服务器。但是测试出现一个问题:const char* uri = evhttp_request_uri(req);
struct evkeyvalq http_query;
char *decoded_uri;
decoded_uri = evhttp_decode_uri(uri);
evhttp_parse_query(decoded_uri, &http_query);
if (decoded_uri!= NULL)
{
free(decoded_uri);
decoded_uri = NULL;
}
evhttp_parse_query出现有内存泄漏的问题???
如果注释上面这个函数,内存没有涨,但是放开该函数,会出现每几分钟内存涨0.1. 回复 1# stone531
https://github.com/nmathewson/Libevent/issues/113 如果服务业务需求简单,nodejs开发即可 evhttp_decode_uri 后要自己释放内容,在.h里面有说明。 回复 4# 上层代码有释放,但是还是有泄漏。。。。sxcong
查看过这个帖子,最后能解决的是更新版本么。回复 2# MMMIX
我用的是1.4版本,释放掉就没有了。你用的2.0以上吗
页:
[1]