Skip to content
3 changes: 3 additions & 0 deletions hwcomposer/hwcomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,9 @@ static int hwc_open(const struct hw_module_t* module, const char* name,
if (!property_get_bool("persist.waydroid.cursor_on_subsurface", false))
pdev->display->cursor_surface =
wl_compositor_create_surface(pdev->display->compositor);
else
pdev->display->cursor_surface = nullptr;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really well-versed in C++, but since the display is allocated with struct display *display = new struct display();, this should mean that all its members get value-initialized, which in case of pointers initializes them to nullptr already. Is that not the case here?


if (!pdev->display->height) {
pdev->display->waiting_for_data = true;
pthread_cond_timedwait(&pdev->display->data_available_cond,
Expand Down