Mir

Code review comment for lp:~kdub/mir/screenshot-to-buffer

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> add warning about the limited lifetime of MirError

I don't think a warning is enough. The shared error subtly limits the interface to only one screencast in flight at any time. Another example with async requests:

void callback(buffer, error, context)
{
    // It's not safe to access error here!
}

mir_screencast_capture_to_buffer(buffer1, callback);
mir_screencast_capture_to_buffer(buffer2, callback);

We either need to fix the shared error problem so that concurrent requests can work safely, or, alternatively, explicitly disallow concurrent requests (e.g. abort() if detected).

« Back to merge proposal