mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0024489: Avoid type casts in call to Standard::Free()
Method Standard::Free() is converted to template, so that pointer is nullified using its proper type. Unnecessary type cases in calls to Standard::Free(), Standard::Reallocate(), and NCollection_BaseAllocator::Free() eliminated throughout OCCT code.
This commit is contained in:
6
src/BOPCol/BOPCol_Array1.hxx
Normal file → Executable file
6
src/BOPCol/BOPCol_Array1.hxx
Normal file → Executable file
@@ -68,7 +68,7 @@ template <class Type> class BOPCol_MemBlock {
|
||||
for (i=0; i<mySize; ++i) {
|
||||
myData[i].~Type();
|
||||
}
|
||||
myAllocator->Free((Standard_Address&)myData);
|
||||
myAllocator->Free(myData);
|
||||
//
|
||||
myData=NULL;
|
||||
mySize=0;
|
||||
@@ -177,10 +177,8 @@ template <class Type> class BOPCol_Array1 {
|
||||
while(pBlock) {
|
||||
pNext=pBlock->Next();
|
||||
//
|
||||
//pBlock->~BOPCol_MemBlock<Type> ();
|
||||
pBlock->~BOPCol_XMemBlock();
|
||||
//pBlock->Clear();
|
||||
myAllocator->Free((Standard_Address&)pBlock);
|
||||
myAllocator->Free(pBlock);
|
||||
//
|
||||
pBlock=pNext;
|
||||
}
|
||||
|
Reference in New Issue
Block a user