Merge changes I732bc5ca,If7948cdd

* changes:
  [liba] Abort if malloc does not return a defined pointer
  [apps/shared] In list controller, if the number of rows has decreased, reinit the scrolling before selecting the last row
This commit is contained in:
Émilie Feral
2017-04-11 10:50:02 +02:00
committed by Gerrit
2 changed files with 7 additions and 0 deletions

View File

@@ -153,6 +153,7 @@ void ListController::didBecomeFirstResponder() {
m_selectableTableView.selectCellAtLocation(m_selectableTableView.selectedColumn(), m_selectableTableView.selectedRow());
}
if (m_selectableTableView.selectedRow() >= numberOfRows()) {
m_selectableTableView.selectCellAtLocation(1, 0);
m_selectableTableView.selectCellAtLocation(m_selectableTableView.selectedColumn(), numberOfRows()-1);
}
footer()->setSelectedButton(-1);

View File

@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <private/memconfig.h>
#if LIBA_LOG_DYNAMIC_MEMORY
@@ -55,6 +56,11 @@ void * malloc(size_t size) {
ion_log_print_integer((uint32_t)size);
ion_log_print_string("\n");
#endif
/* If the process could not find enough space in the memory dedicated to
* dynamic allocation, p is NULL. The conventional malloc just return NULL
* without crashing. However, for debuging purposes, we abort the process
* in that case to easily spot memory leaking. */
assert(p != NULL);
return p;
}