Comment 26 for bug 1758009

Revision history for this message
Cs-gon (cs-gon) wrote :

I think I found the root cause for the compiz-config-profile-setter segfault. The call "ccsFreeContext(context);" in line 218 in compiz_config_profile_setter.c frees the context object while background event processing still uses the object, which then leads to the segfault.

It seems the set_compiz_profile() call returns while a value-changed callback gets called in the background, which then calls ccsObjectGetInterface_() on the context object, but by then the context object already got destroyed.

I think the best way so solve this, would be to wait for the event processing to finish before freeing the context object, but I don't know how to do that properly. But not freeing the context object in compiz_config_profile_setter.c fixes the problem for me (the cssFreeContext() is called right before the compiz-config-profile-setter exits, so I think it doesn't really matter much). So
 with this patch the memory gets freed on exiting of the program after the main loop has stopped.