[PATCH] Do not set output->current_mode in compositor.c

Axel Davy axel.davy at ens.fr
Fri Nov 8 03:55:53 PST 2013


The field is already set - correctly - in the backend switch_mode.
setting output->current_mode to mode in compositor.c leads to bugs,
since mode can be freed by the shell.
For example, the shell allocates it on the stack for
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER
---
 src/compositor.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/compositor.c b/src/compositor.c
index 36b54b5..6084e6b 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -138,7 +138,6 @@ weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode
 		if (ret < 0)
 			return ret;
 
-		output->current_mode = mode;
 		output->current_scale = scale;
 		break;
 	case WESTON_MODE_SWITCH_RESTORE_NATIVE:
-- 
1.8.1.2



More information about the wayland-devel mailing list