console: fix debug messages for buffer objects

It doesn't make sense to print the size of new buffer objects as the resize
function does the same. We also currently access uninitialized memory here so it
is useless anyway.
Also move the message of the unref function to be consistent with other objects.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2011-12-30 17:08:01 +01:00
parent b8124efaf9
commit 22da12c999

View File

@ -212,13 +212,12 @@ int kmscon_buffer_new(struct kmscon_buffer **out, unsigned int x,
if (!buf)
return -ENOMEM;
log_debug("console: new buffer with size %ux%u\n", buf->size_x,
buf->size_y);
memset(buf, 0, sizeof(*buf));
buf->ref = 1;
buf->sb_max = DEFAULT_SCROLLBACK;
log_debug("console: new buffer object\n");
ret = kmscon_buffer_resize(buf, x, y);
if (ret)
goto err_free;
@ -250,8 +249,6 @@ void kmscon_buffer_unref(struct kmscon_buffer *buf)
if (--buf->ref)
return;
log_debug("console: destroying buffer object\n");
for (iter = buf->sb_first; iter; ) {
tmp = iter;
iter = iter->next;
@ -263,6 +260,7 @@ void kmscon_buffer_unref(struct kmscon_buffer *buf)
free(buf->current);
free(buf);
log_debug("console: destroying buffer object\n");
}
/*