aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-30 16:25:09 +0000
committerGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-30 16:25:09 +0000
commit8c0f3d8047868a03255258128e486dbe0f85a9df (patch)
treeedccec1da2382192b9f546200491821c53194d97
parent4a018bb20bf969a38ec11d9506843f06366dfa7c (diff)
Can't put a variable sized array of non-pod on the stack. Use SkAutoTDeleteArray instead.
git-svn-id: http://skia.googlecode.com/svn/trunk@2557 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--src/utils/mac/SkOptionsTableView.mm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils/mac/SkOptionsTableView.mm b/src/utils/mac/SkOptionsTableView.mm
index 2ee025efc8..41c7d4d791 100644
--- a/src/utils/mac/SkOptionsTableView.mm
+++ b/src/utils/mac/SkOptionsTableView.mm
@@ -91,7 +91,8 @@
int index = 0, count = 0;
SkOSMenu::FindListItemCount(*item->getEvent(), &count);
NSMutableArray* optionstrs = [[NSMutableArray alloc] initWithCapacity:count];
- SkString options[count];
+ SkAutoTDeleteArray<SkString> ada(new SkString[count]);
+ SkString* options = ada.get();
SkOSMenu::FindListItems(*item->getEvent(), options);
for (int i = 0; i < count; ++i)
[optionstrs addObject:[NSString stringWithUTF8String:options[i].c_str()]];