summaryrefslogtreecommitdiff
path: root/sc/source/core/data/bcaslot.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/bcaslot.cxx')
-rw-r--r--sc/source/core/data/bcaslot.cxx12
1 files changed, 4 insertions, 8 deletions
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 389d26217963..a55fbcb5b533 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -637,18 +637,14 @@ void ScBroadcastAreaSlot::FinallyEraseAreas()
ScBroadcastAreaSlotMachine::TableSlots::TableSlots()
{
- ppSlots = new ScBroadcastAreaSlot* [ nBcaSlots ];
- memset( ppSlots, 0 , sizeof( ScBroadcastAreaSlot* ) * nBcaSlots );
+ ppSlots.reset( new ScBroadcastAreaSlot* [ nBcaSlots ] );
+ memset( ppSlots.get(), 0 , sizeof( ScBroadcastAreaSlot* ) * nBcaSlots );
}
ScBroadcastAreaSlotMachine::TableSlots::~TableSlots()
{
- for ( ScBroadcastAreaSlot** pp = ppSlots + nBcaSlots; --pp >= ppSlots; /* nothing */ )
- {
- if (*pp)
- delete *pp;
- }
- delete [] ppSlots;
+ for ( ScBroadcastAreaSlot** pp = ppSlots.get() + nBcaSlots; --pp >= ppSlots.get(); /* nothing */ )
+ delete *pp;
}
ScBroadcastAreaSlotMachine::ScBroadcastAreaSlotMachine(