An important line is missing in DefaultCControlRegister

Hi Beni,

A line is missing into bibliothek.gui.dock.common.intern.DefaultCControlRegister (into v 1.0.8 and 1.1.0p2) :

        if( area == null )
            throw new NullPointerException( "area is null" );
        if( contents.contains( area ))
            throw new IllegalArgumentException( "area already registered" );
        // Missing line :
        contents.add(area);
    }```

Thanks very much. That is really a stupid mistake. On the bright side, the contents-list is not used for anything important. Most clients won’t have ever noticed this bug.

I notice that because i’m using the CControle#removeContentArea method. Without this line, dockables are not automatically closed.

Ok. For a workaround until the next release you can call this piece of code to remove the CContentArea properly:

            CControl control = ...
            CContentArea content = ...

            for( CStation<?> station : content.getStations() ){
                control.remove( station );
            }```

Thanks for this piece of code. I will use it for now :slight_smile: