m_menuBarFrame = frame;
- // create the accel table - we consider that the toolbar construction is
+ // create the accel table - we consider that the menubar construction is
// finished
size_t nAccelCount = 0;
int i;
nAccelCount += m_menus[i]->GetAccelCount();
}
- wxAcceleratorEntry *accelEntries = new wxAcceleratorEntry[nAccelCount];
-
- nAccelCount = 0;
- for ( i = 0; i < m_menuCount; i++ )
+ if ( nAccelCount )
{
- nAccelCount += m_menus[i]->CopyAccels(&accelEntries[nAccelCount]);
- }
+ wxAcceleratorEntry *accelEntries = new wxAcceleratorEntry[nAccelCount];
- m_accelTable = wxAcceleratorTable(nAccelCount, accelEntries);
+ nAccelCount = 0;
+ for ( i = 0; i < m_menuCount; i++ )
+ {
+ nAccelCount += m_menus[i]->CopyAccels(&accelEntries[nAccelCount]);
+ }
+
+ m_accelTable = wxAcceleratorTable(nAccelCount, accelEntries);
- delete [] accelEntries;
+ delete [] accelEntries;
+ }
}
// ---------------------------------------------------------------------------