Skip to content

Found a crash in nemo #3615

@kdmenk

Description

@kdmenk

Distribution

Linux Mint cinemon, but cloned nemo master

Package version

nemo master

Frequency

Always

Bug description

In the file src/nemo-tree-sidebar.c i found a bug in the callback registration/deregistration:

See in function fm_tree_view_init at line 1718:

g_signal_connect_swapped (**nemo_preferences**,
			  "changed::" NEMO_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES,
			  G_CALLBACK (filtering_changed_callback), view);

g_signal_connect_swapped (nemo_preferences,
              "changed::" NEMO_PREFERENCES_SORT_DIRECTORIES_FIRST,
              G_CALLBACK (sort_directories_first_changed_callback), view);
              
g_signal_connect_swapped (nemo_preferences,
              "changed::" NEMO_PREFERENCES_SORT_FAVORITES_FIRST,
              G_CALLBACK (sort_favorites_first_changed_callback), view);

And in same file below function fm_tree_view_dispose line 1817:

g_signal_handlers_disconnect_by_func (**nemo_preferences**,
				      G_CALLBACK(filtering_changed_callback),
				      view);
g_signal_handlers_disconnect_by_func (**nemo_preferences**,
                      G_CALLBACK(sort_directories_first_changed_callback),
                      view);
g_signal_handlers_disconnect_by_func (**nemo_preferences**,
                      G_CALLBACK(sort_favorites_first_changed_callback),
                      view);

You will find an incosistent disconnect with nemo_preferences and nemo_tree_sidebar_preferences!
This leeds to dangling event registartions which brings a crash when usung updates and toggle between Places and Treeview

Above is critical...
I found also some memory leeks not includes in this message...

Steps to reproduce

Toggle between Show Places and Show Treeview , while changing "sort folder before files" wich fires an related event...

Expected behavior

Nemo will crash

Additional information

I Think the code above helps to fix the bug already

As I mentioned, I found some not freed memory too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions