#604: EXC_BAD_ACCESS while opening stream
-----------------------------------+----------------------------------------
Reporter: jakub.su...@… | Owner: lsansone...@…
Type: defect | Status: closed
Priority: critical | Milestone: MacRuby 0.6
Component: MacRuby | Resolution: invalid
Keywords: |
-----------------------------------+----------------------------------------
Changes (by martinlagarde...@…):
* status: new => closed
* resolution: => invalid
* milestone: => MacRuby 0.6
Comment:
OK, we found the culprit.
The problem is that `ASIHTTPRequest` defines `ASIInputStream`, which
inherits from `NSObject` (and not `NSInputStream` because it's a little
bit complicated).
To overcome this limitation and simulate inheriting `NSInputStream`,
`ASIInputStream` forwards all unknown invocations to its internal
`NSInputStream`.
However, since MacRuby defines `#open` on `Kernel` (included by `Object`),
when `-open` is sent to `ASIInputStream`, the Obj-C runtime considers the
object knows how to respond to this message, which is why instead of
asking the object if a message forwarding is needed, it just sends it
`-open` (aka our `rb_f_open`).
The fix is very easy, and I am going to mail the author of ASIHTTPRequest
just in case. Open `ASIInputStream.m`, and add the following between the
implementations of `-read:maxLength:` and `methodSignatureForSelector:`:
{{{
- (void)open
{
[stream open];
}
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/604#comment:8>
MacRuby <http://macruby.org/>
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel