[Xcb] Segmentation fault while looping through protocol atoms list
Michael Stapelberg
michael+xcb at stapelberg.de
Thu Nov 29 04:02:59 PST 2012
Hi Micah,
Micah Nordland <mpnordland at gmail.com> writes:
> Well, I went ahead and did this in my constructor:
> _protocols.atoms_len = 0;
> and it seems to have done the trick. After pondering awesome's source,
> I changed the way I was doing things, and changed my protocol getting code
> to:
> void Window::updateWMProtocols()
> {
> xcb_icccm_get_wm_protocols_reply_t reply;
> xcb_generic_error_t *err;
> xcb_get_property_cookie_t cookie =
> xcb_icccm_get_wm_protocols(globalconf.conn,
>
> _id,
>
> globalconf.atomMap["WM_PROTOCOLS"]);
>
> uint8_t ret = xcb_icccm_get_wm_protocols_reply(globalconf.conn, cookie,
> &reply, &err);
> if (ret == 0)
> {
> return;
> }
> _protocols = reply;
> }
>
> So far this has worked, will it bite me in the future?
No, this seems fine. Especially since you swap the value of
_protocols.
--
Best regards,
Michael
More information about the Xcb
mailing list