Merge "buffer.h: Only allow Init() to be called once."

This commit is contained in:
Johann Koenig 2017-06-28 22:36:05 +00:00 committed by Gerrit Code Review
commit d91af5f905

View File

@ -95,6 +95,7 @@ class Buffer {
bool CheckValues(const Buffer<T> &a) const; bool CheckValues(const Buffer<T> &a) const;
bool Init() { bool Init() {
if (raw_buffer_ != NULL) return false;
EXPECT_GT(width_, 0); EXPECT_GT(width_, 0);
EXPECT_GT(height_, 0); EXPECT_GT(height_, 0);
EXPECT_GE(top_padding_, 0); EXPECT_GE(top_padding_, 0);