Skip to content
Snippets Groups Projects
  • Jean Chalard's avatar
    5c32b6da
    Make sure all FDs are correctly closed. · 5c32b6da
    Jean Chalard authored
    In this kind of series of calls, it's possible that an outer call to a
    constructor fails, but the inner succeeded.
    Example:
    try {
        is = new A(new B());
    } finally {
        if (null != is) is.close();
    }
    In this case, if new B() succeeds but new A() throws an
    exception, is stays null and the intermediate object is never
    closed. This is what was happening in this instance.
    
    Bug: 7377336
    Change-Id: I3fae9fec1135244982fcf5098c76d93f3e0f2add
    5c32b6da
    History
    Make sure all FDs are correctly closed.
    Jean Chalard authored
    In this kind of series of calls, it's possible that an outer call to a
    constructor fails, but the inner succeeded.
    Example:
    try {
        is = new A(new B());
    } finally {
        if (null != is) is.close();
    }
    In this case, if new B() succeeds but new A() throws an
    exception, is stays null and the intermediate object is never
    closed. This is what was happening in this instance.
    
    Bug: 7377336
    Change-Id: I3fae9fec1135244982fcf5098c76d93f3e0f2add