mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[shared] Create ExpiringPointer: in DEBUG, check that pointers to
memoized functions are not used when invalid
This commit is contained in:
@@ -103,7 +103,7 @@ bool StorageSumGraphController::handleEvent(Ion::Events::Event event) {
|
||||
bool StorageSumGraphController::moveCursorHorizontallyToPosition(double x) {
|
||||
StorageFunctionApp * myApp = static_cast<StorageFunctionApp *>(app());
|
||||
assert(!m_record.isNull());
|
||||
StorageFunction * function = myApp->functionStore()->modelForRecord(m_record);
|
||||
ExpiringPointer<StorageFunction> function = myApp->functionStore()->modelForRecord(m_record);
|
||||
double y = function->evaluateAtAbscissa(x, myApp->localContext());
|
||||
m_cursor->moveTo(x, y);
|
||||
if (m_step == Step::FirstParameter) {
|
||||
@@ -191,7 +191,7 @@ bool StorageSumGraphController::handleEnter() {
|
||||
m_step = (Step)((int)m_step+1);
|
||||
StorageFunctionApp * myApp = static_cast<StorageFunctionApp *>(app());
|
||||
assert(!m_record.isNull());
|
||||
StorageFunction * function = myApp->functionStore()->modelForRecord(m_record);
|
||||
ExpiringPointer<StorageFunction> function = myApp->functionStore()->modelForRecord(m_record);
|
||||
double sum = function->sumBetweenBounds(m_startSum, m_endSum, myApp->localContext());
|
||||
m_legendView.setSumSymbol(m_step, m_startSum, m_endSum, sum, createFunctionLayout(function));
|
||||
m_legendView.setLegendMessage(I18n::Message::Default, m_step);
|
||||
|
||||
Reference in New Issue
Block a user