+static bool checkFirstReq(afb_req req){
+ wmClientCtxt* ctxt = (wmClientCtxt*)afb_req_context_get(req);
+ return (ctxt) ? false : true;
+}
+
+static void cbRemoveClientCtxt(void* data){
+ wmClientCtxt* ctxt = (wmClientCtxt*)data;
+ if(ctxt == nullptr){
+ return;
+ }
+ HMI_DEBUG("wm","remove app %s", ctxt->name.c_str());
+ // Lookup surfaceID and remove it because App is dead.
+ auto pSid = g_afb_instance->app.id_alloc.lookup(ctxt->name.c_str());
+ if(pSid){
+ auto sid = *pSid;
+ g_afb_instance->app.id_alloc.remove_id(sid);
+ g_afb_instance->app.layers.remove_surface(sid);
+ g_afb_instance->app.controller->sprops.erase(sid);
+ g_afb_instance->app.controller->surfaces.erase(sid);
+ HMI_DEBUG("wm", "delete surfaceID %d", sid);
+ }
+ delete ctxt;
+}
+