Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

_commitLoadWithData bug?!



Hello list,
I'm using WebKit in a program of mine in order to render some data.
In my application there are two webviews: A tree with data (when you
click a link it loads related data inside the second webview) and
another webview where the data were loaded.
This data was created in two different step.
1- Raw data - simple text - is parsed by an engine and the output is
an XML file.
2- This XML is processed by an XSL transformation
3- Finally the HTML result is rendered by a WebView

In order to perform a custom loading of my data I've used a special
protocol (I've used PictureBrowser Protocol scheme into Dev Examples).
It works well but sometimes (random!) when I try to load some data
from the map the program itself crashes. I've tried to reproduce the
problem itself but it happens without any particular scheme: sometimes
if a click a LINK X it loads...sometimes it crashes.
The error is a WebKit error. You can see my program's backtrace here:

http://img213.imageshack.us/img213/6733/immagine1wh1.png

This is my Protocol Class.
Anyone can tell me what's wrong? Is this a know bug of WebKit or a
mistake of mine?

#import "NNTPURLProtocol.h"
#import <Foundation/Foundation.h>
#import <Foundation/NSError.h>

NSString *PictureBrowserScheme = @"nntp";
static Class dataProvider;
@implementation NNTPURLProtocol

+ (void)setDataProvider:(Class)aClass {
   [NSURLProtocol registerClass:[NNTPURLProtocol class]];
   dataProvider = aClass;
}


+ (BOOL)canInitWithRequest:(NSURLRequest *)theRequest{ return ([[[theRequest URL] scheme] caseInsensitiveCompare: PictureBrowserScheme] == NSOrderedSame); }

+(NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request {
return request; }

- (void)startLoading{
	NSLog(@"START LOADING MESSAGE...");
	id<NSURLProtocolClient> client = [self client];
   NSURLRequest *request = [self request];

	NSString *msgid = [[[request URL] absoluteString]
stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
	if (msgid == nil) msgid = [[request URL] absoluteString];

	/* HERE THERE IS THE CODE THAT CALL LOADMESSAGE INTO THE SECOND WEBVIEW. */	

	/* FINISHING.... */
	     NSURLResponse *response = [[NSURLResponse alloc]
initWithURL:[request URL] MIMEType:@"text/html"
expectedContentLength:-1 textEncodingName:@"utf-16"];
       [client URLProtocol:self didReceiveResponse:response
cacheStoragePolicy:NSURLCacheStorageNotAllowed];
       [client URLProtocol:self didLoadData:nil];
		[client URLProtocolDidFinishLoading:self];
		[response release];	
}
}

- (void)stopLoading{}
@end
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.