mir_connection_create_surface callback is sometimes called twice on error

Bug #1394873 reported by Chris Halse Rogers
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Robert Carr
mir (Ubuntu)
Fix Released

Bug Description

I've just run into some fun behaviour. In mir_surface.cpp, in the surface constructor, if:

server.create_surface(0, &message, &surface, gp::NewCallback(this, &MirSurface::created, callback, context));

throws (such as if the RPC mechanism detects a connection break) then the created callback is called on the partially constructed MirSurface that's just about to be destructed. mir_connection_create_surface catches this exception and then calls the callback *again*, with an newly constructed error MirSurface.

This is likely to confuse API users :)

Related branches

Changed in mir:
assignee: nobody → Robert Carr (robertcarr)
status: New → In Progress
milestone: none → 0.10.0
Changed in mir:
status: In Progress → Fix Committed
importance: Undecided → Medium
Changed in mir:
status: Fix Committed → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

mir (0.10.0+15.04.20150107.2-0ubuntu1) vivid; urgency=medium

Changed in mir (Ubuntu):
importance: Undecided → Medium
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers