[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH] winemac.drv: Always initialize a closure-captured object pointer.
From:       Ken Thomases <ken () codeweavers ! com>
Date:       2015-01-30 5:04:48
Message-ID: CB873288-E9EA-40CE-AAB4-C206D42B8DCD () codeweavers ! com
[Download RAW message or body]

On Jan 29, 2015, at 5:23 PM, Charles Davis <cdavis5x@gmail.com> wrote:

> You might argue that we don't need to do this because we only use it on
> the control paths where we initialize it. Ah, but it *is* used on one of
> the other paths: it is captured by the Block closure whether or not we
> actually use it inside the Block. This means that, when we copy the
> Block onto the heap in OnMainThreadAsync(), the runtime will attempt to
> retain it. For some reason, we got away with this in 32-bit
> land--probably because the pointer happened to be NULL anyway--but it
> broke and died horribly on 64-bit.
> 
> With this change, 64-bit winemac.drv is actually usable.

Nice.  I was aware of the warning but assumed that it was benign.  I'm not sure it's \
a coincidence that it worked in 32-bit.  I don't think that dispatch objects are \
actually automatically retained by blocks which reference them in 32-bit.  It's not \
entirely related, but it's relatively recent that ARC started doing that and, of \
course, that requires the modern Objective-C runtime and thus 64-bit.

Anyway, I'm glad the Mac driver crashiness in the 64-bit build stemmed from a single \
cause.  I'm sure it wasn't fun to find it.  Thanks for doing so.

-Ken


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic