зеркало из https://github.com/mozilla/pjs.git
Fix refcount crash with find again. (bug 150532)
This commit is contained in:
Родитель
292eadf526
Коммит
a250656d2b
|
@ -50,6 +50,7 @@
|
|||
|
||||
-(IBAction) find: (id)aSender;
|
||||
-(IBAction) findAgain: (id)aSender;
|
||||
-(void) storeSearchText:(NSString*)inText;
|
||||
|
||||
// delegates for NSTextView
|
||||
- (void)controlTextDidChange:(NSNotification *)aNotification;
|
||||
|
|
|
@ -42,12 +42,23 @@
|
|||
|
||||
@implementation FindDlgController
|
||||
|
||||
- (id)initWithWindowNibName:(NSString *)windowNibName
|
||||
{
|
||||
if ( (self = [super initWithWindowNibName:windowNibName]) )
|
||||
mSearchText = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[mSearchText release];
|
||||
}
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// -find
|
||||
//
|
||||
|
@ -59,7 +70,7 @@
|
|||
NSWindowController* controller = [[NSApp mainWindow] windowController];
|
||||
if ( [controller conformsToProtocol:@protocol(CHFind)] ) {
|
||||
id<CHFind> browserController = controller;
|
||||
mSearchText = [mSearchField stringValue];
|
||||
[self storeSearchText:[mSearchField stringValue]];
|
||||
BOOL found = [browserController findInPage:mSearchText];
|
||||
if ( found )
|
||||
[self close];
|
||||
|
@ -104,4 +115,11 @@
|
|||
[mFindButton setEnabled:PR_FALSE];
|
||||
}
|
||||
|
||||
|
||||
- (void)storeSearchText:(NSString*)inText
|
||||
{
|
||||
[mSearchText autorelease];
|
||||
mSearchText = inText;
|
||||
[mSearchText retain];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
-(IBAction) find: (id)aSender;
|
||||
-(IBAction) findAgain: (id)aSender;
|
||||
-(void) storeSearchText:(NSString*)inText;
|
||||
|
||||
// delegates for NSTextView
|
||||
- (void)controlTextDidChange:(NSNotification *)aNotification;
|
||||
|
|
|
@ -42,12 +42,23 @@
|
|||
|
||||
@implementation FindDlgController
|
||||
|
||||
- (id)initWithWindowNibName:(NSString *)windowNibName
|
||||
{
|
||||
if ( (self = [super initWithWindowNibName:windowNibName]) )
|
||||
mSearchText = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[mSearchText release];
|
||||
}
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// -find
|
||||
//
|
||||
|
@ -59,7 +70,7 @@
|
|||
NSWindowController* controller = [[NSApp mainWindow] windowController];
|
||||
if ( [controller conformsToProtocol:@protocol(CHFind)] ) {
|
||||
id<CHFind> browserController = controller;
|
||||
mSearchText = [mSearchField stringValue];
|
||||
[self storeSearchText:[mSearchField stringValue]];
|
||||
BOOL found = [browserController findInPage:mSearchText];
|
||||
if ( found )
|
||||
[self close];
|
||||
|
@ -104,4 +115,11 @@
|
|||
[mFindButton setEnabled:PR_FALSE];
|
||||
}
|
||||
|
||||
|
||||
- (void)storeSearchText:(NSString*)inText
|
||||
{
|
||||
[mSearchText autorelease];
|
||||
mSearchText = inText;
|
||||
[mSearchText retain];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
-(IBAction) find: (id)aSender;
|
||||
-(IBAction) findAgain: (id)aSender;
|
||||
-(void) storeSearchText:(NSString*)inText;
|
||||
|
||||
// delegates for NSTextView
|
||||
- (void)controlTextDidChange:(NSNotification *)aNotification;
|
||||
|
|
|
@ -42,12 +42,23 @@
|
|||
|
||||
@implementation FindDlgController
|
||||
|
||||
- (id)initWithWindowNibName:(NSString *)windowNibName
|
||||
{
|
||||
if ( (self = [super initWithWindowNibName:windowNibName]) )
|
||||
mSearchText = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[mSearchText release];
|
||||
}
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// -find
|
||||
//
|
||||
|
@ -59,7 +70,7 @@
|
|||
NSWindowController* controller = [[NSApp mainWindow] windowController];
|
||||
if ( [controller conformsToProtocol:@protocol(CHFind)] ) {
|
||||
id<CHFind> browserController = controller;
|
||||
mSearchText = [mSearchField stringValue];
|
||||
[self storeSearchText:[mSearchField stringValue]];
|
||||
BOOL found = [browserController findInPage:mSearchText];
|
||||
if ( found )
|
||||
[self close];
|
||||
|
@ -104,4 +115,11 @@
|
|||
[mFindButton setEnabled:PR_FALSE];
|
||||
}
|
||||
|
||||
|
||||
- (void)storeSearchText:(NSString*)inText
|
||||
{
|
||||
[mSearchText autorelease];
|
||||
mSearchText = inText;
|
||||
[mSearchText retain];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
-(IBAction) find: (id)aSender;
|
||||
-(IBAction) findAgain: (id)aSender;
|
||||
-(void) storeSearchText:(NSString*)inText;
|
||||
|
||||
// delegates for NSTextView
|
||||
- (void)controlTextDidChange:(NSNotification *)aNotification;
|
||||
|
|
|
@ -42,12 +42,23 @@
|
|||
|
||||
@implementation FindDlgController
|
||||
|
||||
- (id)initWithWindowNibName:(NSString *)windowNibName
|
||||
{
|
||||
if ( (self = [super initWithWindowNibName:windowNibName]) )
|
||||
mSearchText = nil;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[mSearchText release];
|
||||
}
|
||||
|
||||
- (void)windowDidLoad
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// -find
|
||||
//
|
||||
|
@ -59,7 +70,7 @@
|
|||
NSWindowController* controller = [[NSApp mainWindow] windowController];
|
||||
if ( [controller conformsToProtocol:@protocol(CHFind)] ) {
|
||||
id<CHFind> browserController = controller;
|
||||
mSearchText = [mSearchField stringValue];
|
||||
[self storeSearchText:[mSearchField stringValue]];
|
||||
BOOL found = [browserController findInPage:mSearchText];
|
||||
if ( found )
|
||||
[self close];
|
||||
|
@ -104,4 +115,11 @@
|
|||
[mFindButton setEnabled:PR_FALSE];
|
||||
}
|
||||
|
||||
|
||||
- (void)storeSearchText:(NSString*)inText
|
||||
{
|
||||
[mSearchText autorelease];
|
||||
mSearchText = inText;
|
||||
[mSearchText retain];
|
||||
}
|
||||
@end
|
||||
|
|
Загрузка…
Ссылка в новой задаче