Not registering a lifecycle delegate instance causes ubuntuappmanager to segfault

Bug #1190035 reported by Jim Hodapp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
platform-api
New
Undecided
Unassigned

Bug Description

If I try and call ua_ui_window_new_for_application_with_properties() without having first installed a lifecycle delegate instance, the call fails because ubuntuappmanager segfaults.

Example code to reproduce:

    UAUiDisplay *display;
    int surface_height, surface_width;
    UAUiWindowProperties *wprops;
    UApplicationDescription *desc;
    UApplicationInstance *uainstance;
    UApplicationLifecycleDelegate *delegate;
    UAUiSession *uasession;
    UAUiSessionProperties *sprops;
    UAUiWindow *window;
    EGLNativeWindowType native_window;

    sprops = ua_ui_session_properties_new();
    ua_ui_session_properties_set_type(sprops, U_SYSTEM_SESSION);
    uasession = ua_ui_session_new_with_properties(sprops);
    if (!uasession)
        GST_WARNING ("Failed to start new UA session");

    display = ua_ui_display_new_with_index(0);

    surface_height = ua_ui_display_query_vertical_res(display);
    surface_width = ua_ui_display_query_horizontal_res(display);

    GST_DEBUG ("Display resolution: (%d,%d)\n",
           surface_height,
           surface_width);

    desc = u_application_description_new();
    delegate = u_application_lifecycle_delegate_new();
    u_application_lifecycle_delegate_set_context(delegate, window_data);
    u_application_description_set_application_lifecycle_delegate(desc, delegate);

    uainstance = u_application_instance_new_from_description_with_options(desc, NULL);
    if (!uainstance)
        GST_WARNING ("Failed to start a new UA instance");

    wprops = ua_ui_window_properties_new_for_normal_window();
    ua_ui_window_properties_set_titlen(wprops, "EglSinkWindow", 13);
    // Use the default role for apps
    ua_ui_window_properties_set_role(wprops, 1);
    GST_DEBUG ("Creating new UA window");
    window = ua_ui_window_new_for_application_with_properties(uainstance, wprops);

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.