[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#3605: Crash in ns_index_color (nsterm.m:1305)

From: Adrian Robert
Subject: bug#3605: Crash in ns_index_color (nsterm.m:1305)
Date: Thu, 23 Jul 2009 11:36:10 -0400

On Jul 23, 2009, at 11:16 AM, David Reitter wrote:

On Jul 23, 2009, at 3:46 PM, Adrian Robert wrote:

If you could please retest this against the latest branch or trunk, I've checked in some robustness improvement to the indexed color stuff that may clear this up.

Further to that, I don't think your change is as safe as it could be.
Below is what I did in Aquamacs:master: I'm returning an actual color in case the index is invalid, rather than nil. Is ns_lookup_indexed_color() generally expected to return nil if something goes wrong? It's cleaner than returning something random, but it'll still lead to an error if unchecked.

nil should not cause a problem because sending a message to nil is a no-op in Objective-C.

The problem with returning orange as you do is that the semantics of the table are such that all colors are retained, whereas the orangeColor is autoreleased. Better would be to put an actual color entry into slot 0, and retain it, then return this as the default.

Have you found any pattern to the 0's when using the orange?

We should develop a means of periodically moving tested improvements from Aquamacs development into the mainline.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]