Commit 9920fb61 authored by Alexander Hirsch's avatar Alexander Hirsch
Browse files

C Slides: Fix goto acquire release bug

parent 5cb80f6e
......@@ -417,9 +417,10 @@ bool do_something(void)
result = do_something_with_resources(resource_a, resource_b, resource_c);
error3: release_resource_c(resource_c); // only allowed if acquired
error2: release_resource_b(resource_b);
error1: release_resource_a(resource_a);
release_resource_c(resource_c); // only allowed if acquired
error3: release_resource_b(resource_b); // only allowed if acquired
error2: release_resource_a(resource_a); // only allowed if acquired
error1:
return result;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment