Re: NSTextView crashes with web content
Re: NSTextView crashes with web content
- Subject: Re: NSTextView crashes with web content
- From: Mike Wright <email@hidden>
- Date: Sun, 3 Oct 2004 11:00:55 -0700
On Oct 2, 2004, at 9:30 PM, Renaud Boisjoly wrote:
1. In TextEdit or another NNSTextView-based program,
1. In Safari (not sure about other browsers), go to
https://optionslink.etrade.com/e/t/applogic/OlNonLoginHome
2. Select the whole page(Command-A) and Copy
3. Switch to TextEidt and Paste in a new document
4. Select All, Copy and Paste twice
5. Select All, Copy and Paste a few times
After 6 or 7 times, TextEidt or the other App will crash.
I've seen something similar. I've also seen it with certain types of
email content--especially advertising with combined text and images.
The code where the error occurred looked something like this:
BOOL goodPBoard ;
NSPasteboard *pboard = [NSPasteboard generalPasteboard];
goodPBoard = [myTextView readSelectionFromPasteboard:pboard];
Originally, the error caused the routine containing this code to exit
prematurely, often causing a crash.
Now I use @try, @catch, and @finally to make sure the routine
containing these lines is completed.
Here are some actual examples of exceptions raised by various
pasteboard content as they appeared in the debugger:
*** NSRunStorage, _NSBlockNumberForIndex(): index (3980) beyond array
bounds (1000)
*** NSRunStorage, _NSBlockNumberForIndex(): index (152166) beyond array
bounds (2000)
*** NSRunStorage, _NSBlockNumberForIndex(): index (40555) beyond array
bounds (4000)
*** NSRunStorage, _NSBlockNumberForIndex(): index (4363) beyond array
bounds (3000)
The first one comes from going to
http://www.digitaleyes.net/Details.cfm?info=PIO012301 and copying
everything from "eX Driver The Movie" down to "Production Art" at the
end, then pasting it.
The interesting thing is that, in spite of the exception, the copied
material seems to paste in just fine. It doesn't appear to be
corrupted, displays okay, and can be saved.
I've wondered whether this qualifies as a bug in the
-readSelectionFromPasteboard routine.
--
Mike Wright
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden