Move more of defragment inside the __try block.

This commit is contained in:
Alex 2023-02-05 07:44:36 +03:00
parent bf1a8f2582
commit b913e9be1e
1 changed files with 6 additions and 6 deletions

View File

@ -275,14 +275,14 @@ bool CACHED_CONTAINER::reallocate( unsigned int aSize )
void CACHED_CONTAINER::defragment( VERTEX* aTarget )
{
// Defragmentation
ITEMS::iterator it, it_end;
int newOffset = 0;
#ifdef __WIN32__
__try
#endif
{
// Defragmentation
ITEMS::iterator it, it_end;
int newOffset = 0;
for( VERTEX_ITEM* item : m_items )
{
int itemOffset = item->GetOffset();
@ -306,6 +306,8 @@ void CACHED_CONTAINER::defragment( VERTEX* aTarget )
m_item->setOffset( newOffset );
m_chunkOffset = newOffset;
}
m_maxIndex = usedSpace();
}
#ifdef __WIN32__
__except( GetExceptionCode() == STATUS_ACCESS_VIOLATION ? EXCEPTION_EXECUTE_HANDLER
@ -315,8 +317,6 @@ void CACHED_CONTAINER::defragment( VERTEX* aTarget )
"system or GPU memory running low." );
};
#endif
m_maxIndex = usedSpace();
}