DDE后端(非dentry):测试中发现的不足和bug

inotify源码:https://github.com/linuxdeepin/dde/tree/develop/app/desktop

测试代码源码:https://github.com/linuxdeepin/dde/tree/desktop_test/app/desktop/test

1. handle_rename()内存溢出

[ 19%] Testing handle_rename...
** (desktop:4431): WARNING **: Did't know file type /tmp/test_files/360wallpaper38.jpg2
** Message: console message: file:///home/ycl/dde/resources//desktop/js/desktop.js @42: don't support type

[ 19%] Testing handle_rename...

** (desktop:4431): ERROR **: Test handle_rename Failed

跟踪/断点陷阱

 

void handle_rename(GFile *, GFile *);
Test({
GFile *old_f = g_file_new_for_path(file1);
gchar *filename = g_strconcat(file1, "2", NULL);
GFile *new_f = g_file_new_for_path(filename);
handle_rename(old_f, new_f);

g_free(filename);
g_object_unref(old_f);
g_object_unref(new_f);
}, "handle_rename");

 

2、void handle_new(GFile* f);

bug同上

3、pixbuf.c中get_data_uri_by_path()中未释pixbuf

现在已释放

char* get_data_uri_by_path(const char* path)
{
    GError *error = NULL;
    GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file(path, &error);
    if (error != NULL) {
        g_warning("%s\n", error->message);
        g_error_free(error);
        return NULL;
    }
    char* c = get_data_uri_by_pixbuf(pixbuf);
    g_object_unref(pixbuf);
    return c;

}

 

4、pixbuf_to_canvas_data执行效率太低了,很慢

一个百度的logo,test 1分钟才到2%。 有待优化,里面就是用两个for循环对图像处理的

char* pixbuf_to_canvas_data(GdkPixbuf* pixbuf)

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值