Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1159)

Unified Diff: chrome/browser/cocoa/keyword_editor_cocoa_controller.mm

Issue 262028: [Mac] Fix keyword editor-related crashes (Closed)
Patch Set: Fix NSException Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
diff --git a/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm b/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
index 4198cf0a25299a59e733ea8749671999db875ecf..184e5e3dfcbdcd668a1296f2662f76fbac2fd77d 100644
--- a/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
+++ b/chrome/browser/cocoa/keyword_editor_cocoa_controller.mm
@@ -69,7 +69,9 @@ void KeywordEditorModelObserver::OnItemsChanged(int start, int length) {
}
void KeywordEditorModelObserver::OnItemsAdded(int start, int length) {
- DCHECK_LE(start, static_cast<int>([iconImages_ count]));
+ const NSUInteger count([iconImages_ count]);
+ DCHECK_LE(start, static_cast<int>(count));
+ [iconImages_ setCount:count + length];
Scott Hess - ex-Googler 2009/10/09 02:20:43 This will add length items to iconImages_ and the
pink (ping after 24hrs) 2009/10/09 14:50:38 i don't follow why you need to do this.
Scott Hess - ex-Googler 2009/10/09 14:54:16 -[NSPointerArray insertPointer:atIndex:] requires
for (int i = 0; i < length; ++i) {
[iconImages_ insertPointer:NULL atIndex:start]; // Values slide down.
}
@@ -128,6 +130,8 @@ void KeywordEditorModelObserver::InvalidateIconCache(int start, int length) {
- (void)dealloc {
controller_->table_model()->SetObserver(NULL);
controller_->url_model()->RemoveObserver(observer_.get());
+ [tableView_ setTarget:nil];
Scott Hess - ex-Googler 2009/10/09 02:20:43 If you're going to clear target, clear dataSource,
+ observer_.reset();
[super dealloc];
}
@@ -169,6 +173,7 @@ void KeywordEditorModelObserver::InvalidateIconCache(int start, int length) {
- (void)modelChanged {
Scott Hess - ex-Googler 2009/10/09 14:54:16 To help catch out-of-sync issues (which is what ha
[tableView_ reloadData];
+ [self adjustEditingButtons];
}
- (KeywordEditorController*)controller {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698