#633: Segmentation fault using Net::SMTP on background thread
-----------------------------------+----------------------------------------
Reporter: wbyo...@… | Owner: lsansone...@…
Type: defect | Status: new
Priority: major | Milestone:
Component: MacRuby | Keywords:
-----------------------------------+----------------------------------------
The following code causes a segmentation fault. The third line from the
bottom is commented out, but executes the test method on the main thread
and works fine.
I'm using MacRuby version 0.5.
{{{
require 'net/smtp'
framework 'Cocoa'
class Test
def execute
username = ''
password = ''
server = ''
to = ''
port = 0
connection = Net::SMTP.new(server, port)
connection.enable_starttls_auto()
connection.start(server, username, password, :login) {
|smtp|
smtp.send_message "Subject: Example\r\n\r\nHello
world!\r\n", nil, [to]
}
end
end
# Test.new.execute
NSThread.detachNewThreadSelector("execute", toTarget:Test.new,
withObject:nil)
NSThread.sleepForTimeInterval(60)
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/633>
MacRuby <http://macruby.org/>
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel