unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Adrian Robert <adrian.b.robert@gmail.com>
To: David Reitter <david.reitter@gmail.com>
Cc: Ben Lowery <blowery@gmail.com>, 3605@emacsbugs.donarmstrong.com
Subject: bug#3605: Crash in ns_index_color (nsterm.m:1305)
Date: Thu, 23 Jul 2009 11:36:10 -0400	[thread overview]
Message-ID: <AA5815E9-228B-4F3E-BADD-C24B6B7CB5C8@gmail.com> (raw)
In-Reply-To: <378AE054-89A8-410E-BB83-D527A4531924@gmail.com>


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	other threads:[~2009-07-23 15:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23 14:46 bug#3605: Crash in ns_index_color (nsterm.m:1305) Adrian Robert
2009-07-23 14:59 ` David Reitter
2009-07-29 14:39   ` Ben Lowery
2009-07-23 15:16 ` David Reitter
2009-07-23 15:36   ` Adrian Robert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-10-22  0:05 Mike
2009-10-20  6:27 Mike
     [not found] <9ee8c1eb0906180743s4cfa6986ic78af206a15e2ce6@mail.gmail.com>
2009-06-18 14:58 ` David Reitter
2009-06-18 18:08   ` Glenn Morris
2010-01-31  5:24   ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AA5815E9-228B-4F3E-BADD-C24B6B7CB5C8@gmail.com \
    --to=adrian.b.robert@gmail.com \
    --cc=3605@emacsbugs.donarmstrong.com \
    --cc=blowery@gmail.com \
    --cc=david.reitter@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).