DESCRIPTION

JVMCBC-154 - Avoid leaking content on not needed config buffers.

Motivation
----------
The carrier loader and refresher both use the bucket config result, but it could
be that the code unsubscribes before the full result is consumed. This is a valid
condition, but code needs to be in place to free all the buffers nonetheless.

Modifications
-------------
Since the generic "release if unsubscribed" behaviour can be reused in lots of places,
a helper method has been introduced to the Buffers class which transparently takes
care.

The loader and refresher have been adapted to account for the automatic release.

Result
------
Even when unsubscribed on config loading, the buffers are properly released. Also
the helper class can be used in various other places as well.

Change-Id: I95c3edcd8b86e36e7328adb76c8585d5b4c992ee
Reviewed-on: http://review.couchbase.org/47855
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx


COMMENTS

author: Gerrit Code Review
date: 2015-03-09 10:35:26.677000000

Change has been successfully cherry-picked as f858a405c9d59242122f823c20c6d5ed593b4eb5

-------------------------------------
