~vanvugt/mir/fix-1226139

« back to all changes in this revision

Viewing changes to examples/eglapp.c

examples: Only check key information for key events

This fixes a memory error reported by valgrind for examples
that use eglapp.

Approved by Alan Griffiths, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
{
95
95
    (void) surface;
96
96
    (void) context;
97
 
    if (ev->key.key_code == XKB_KEY_q && ev->key.action == mir_key_action_up)
 
97
    if (ev->type == mir_event_type_key &&
 
98
        ev->key.key_code == XKB_KEY_q &&
 
99
        ev->key.action == mir_key_action_up)
 
100
    {
98
101
        running = 0;
 
102
    }
99
103
}
100
104
 
101
105
static unsigned int get_bpp(MirPixelFormat pf)