Event handler OnDevice is registered in wl_drm_listener
The code of the handler make the instance(in heap) of type DisplayWayland.
The class DisplayWayland inherits the Drm::Display, the ctor of which can throw the exception (type Exception)
In general - event handler must not throw the exception because there are not any guarantees that C code can handle it
see code
Description
Event handler OnDevice is registered in wl_drm_listener The code of the handler make the instance(in heap) of type DisplayWayland. The class DisplayWayland inherits the Drm::Display, the ctor of which can throw the exception (type Exception) In general - event handler must not throw the exception because there are not any guarantees that C code can handle it see code
void WaylandZCopy::onDevice(const string& name) { lock_guard lock(mMutex);
}
Display::Display () { ... if (mDrmFd < 0) { throw Exception("Cannot open DRM device: " + mName, errno); } ... if (drmGetCap(mDrmFd, DRM_CAP_DUMB_BUFFER, &hasDumb) < 0 || !hasDumb) { throw Exception("Drm device does not support dumb buffers", errno); } }
Solution
Wrap code inside OnDevice in block try{}catch(const Exception&){}