3drepo / 3drepobouncer

A C++ library providing 3D Repo Scene Graph definition, repository management logic and manipulation logic. It is is essentially the refactored 3DRepoCore and (parts of) 3DRepoGUI
GNU Affero General Public License v3.0
29 stars 13 forks source link

Issue 683 - clear the default graph as soon as possible #684

Closed sebjf closed 4 months ago

sebjf commented 4 months ago

This fixes #683.

Description

This PR makes a very small functional change, in that the default graph is cleared after generateAndCommitSelectionTree returns.

However, bouncer often accesses the graphs by iterating over their members, and both the graphs and members are non-nullable. Therefore this PR also makes almost all accesses to the graphs go through a method that checks if the graph has been explicitly cleared, and throws an exception if this is the case, to make certain no accesses to default take place once it has been cleared.

The purpose of this change is to reduce the peak memory of bouncer by freeing the default graph once it is no longer used.

sebjf commented 4 months ago

Dropping this for now as default graph is used in more places than expected and its not clear its worth the refactoring effort at the moment.