Merge branch 'master' into feature/input-revamp

This commit is contained in:
Vicki Pfau 2017-06-03 17:52:22 -07:00
commit fa73d25acb
2 changed files with 4 additions and 7 deletions

View File

@ -147,15 +147,12 @@ void LibraryTree::rebuildTree() {
LibraryEntryRef currentGame = selectedEntry();
int count = m_widget->topLevelItemCount();
for (int a = 0; a < count; a++) {
m_widget->takeTopLevelItem(0);
for (int a = count - 1; a >= 0; --a) {
m_widget->takeTopLevelItem(a);
}
for (QTreeWidgetItem* i : m_pathNodes.values()) {
count = i->childCount();
for (int a = 0; a < count; a++) {
i->takeChild(0);
}
i->takeChildren();
}
if (m_currentStyle == LibraryStyle::STYLE_TREE) {

View File

@ -127,7 +127,7 @@ int CircleBufferWrite16(struct CircleBuffer* buffer, int16_t value) {
size_t CircleBufferWrite(struct CircleBuffer* buffer, const void* input, size_t length) {
int8_t* data = buffer->writePtr;
if (buffer->size + sizeof(int16_t) > buffer->capacity) {
if (buffer->size + length > buffer->capacity) {
return 0;
}
size_t remaining = buffer->capacity - ((int8_t*) data - (int8_t*) buffer->data);