1. Patch for win32lib v0.60.3

This is just a heads-up for an error being reported with the current 
release.

Some programs issued the warning message 

 “LOGIC ERROR: Held resource owner is not the actual owner.”

This was because some font resources were not removed from 
internal tables when the resource was no longer being tracked.

The recommended patch is to add two lines to the library.
In the routine replaceObject(), find the lines ...
   
    if find(pObjType, {kBitmapObject, kIconObject, kFontObject}) = 0 then
        deleteObject(lReplacedObject)
                
and add these lines after them...

    else
       deleteObject({lReplacedObject,{}})

This patch will also be in the next release of course.
                
-- 
Derek Parnell
Melbourne, Australia

new topic     » topic index » view message » categorize

2. Re: Patch for win32lib v0.60.3

Derek Parnell wrote:
> 
> This is just a heads-up for an error being reported with the current 
> release.
> 
> Some programs issued the warning message 
> 
>  “LOGIC ERROR: Held resource owner is not the actual owner.”
> 
> This was because some font resources were not removed from 
> internal tables when the resource was no longer being tracked.
> 
> The recommended patch is to add two lines to the library.
> In the routine replaceObject(), find the lines ...
>    
>     if find(pObjType, {kBitmapObject, kIconObject, kFontObject}) = 0 then
>         deleteObject(lReplacedObject)
>                 
> and add these lines after them...
> 
>     else
>        deleteObject({lReplacedObject,{}})
> 
> This patch will also be in the next release of course.
>                 
> -- 
> Derek Parnell
> Melbourne, Australia
> 
Derek,

I applied the patch and am still getting the error on the following demos:
- backcolor
- bigdots
- bitmaptext

Jonas

new topic     » goto parent     » topic index » view message » categorize

3. Re: Patch for win32lib v0.60.3

Jonas Temple wrote:
> 
> Derek Parnell wrote:
> > 
> > This is just a heads-up for an error being reported with the current 
> > release.
> > 
> > Some programs issued the warning message 
> > 
> >  “LOGIC ERROR: Held resource owner is not the actual owner.”
> > 
> > This was because some font resources were not removed from 
> > internal tables when the resource was no longer being tracked.
> > 
> > The recommended patch is to add two lines to the library.
> > In the routine replaceObject(), find the lines ...
> >    
> >     if find(pObjType, {kBitmapObject, kIconObject, kFontObject}) = 0 then
> >         deleteObject(lReplacedObject)
> >                 
> > and add these lines after them...
> > 
> >     else
> >        deleteObject({lReplacedObject,{}})
> > 
> > This patch will also be in the next release of course.
> >                 
> > -- 
> > Derek Parnell
> > Melbourne, Australia
> > 
> Derek,
> 
> I applied the patch and am still getting the error on the following demos:
> - backcolor
> - bigdots
> - bitmaptext


Thanks Jonas. I've located these mistakes now too. 


The first one is in the queryFont() routine. Find the lines ...

    if id = Printer then
        -- use the printer's dc
        useId = Printer

and add this line before them ...
    saved = {}

and these lines after them ...

    elsif window_type[id] = Pixmap then
        useId = id

Then find the lines ...

    if useId != Printer then
        -- restore the font attributes
        window_font[useId] = saved

and replace them with ...

    if length(saved) != 0 then
        -- restore the font attributes
        window_font[useId] = saved  


The second error is in the trackObject() routine.
In the routine trackObject() find the lines ...

        if heldResource[at][ResOwner] = owner then
            heldResource[at][ResCnt] += 1

and add after them these lines...

        elsif heldResource[at][ResOwner] = -1 then
            -- This resource now has an owner.
            heldResource[at][ResOwner] = owner

Okay, try it now!

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

4. Re: Patch for win32lib v0.60.3

Derek Parnell wrote:
> 
> Thanks Jonas. I've located these mistakes now too. 
> 
> 
> The first one is in the queryFont() routine. Find the lines ...
> 
>     if id = Printer then
>         -- use the printer's dc
>         useId = Printer
> 
> and add this line before them ...
>     saved = {}
> 
> and these lines after them ...
> 
>     elsif window_type[id] = Pixmap then
>         useId = id
> 
> Then find the lines ...
> 
>     if useId != Printer then
>         -- restore the font attributes
>         window_font[useId] = saved
> 
> and replace them with ...
> 
>     if length(saved) != 0 then
>         -- restore the font attributes
>         window_font[useId] = saved  
> 
> 
> The second error is in the trackObject() routine.
> In the routine trackObject() find the lines ...
> 
>         if heldResource[at][ResOwner] = owner then
>             heldResource[at][ResCnt] += 1
> 
> and add after them these lines...
> 
>         elsif heldResource[at][ResOwner] = -1 then
>             -- This resource now has an owner.
>             heldResource[at][ResOwner] = owner
> 
> Okay, try it now!
> 
Derek,

That took care of those demos.  The only other demo that crashed was
childw2.

Jonas

new topic     » goto parent     » topic index » view message » categorize

5. Re: Patch for win32lib v0.60.3

Jonas Temple wrote:
> 
> Derek Parnell wrote:
> > 
> > Thanks Jonas. I've located these mistakes now too. 
> > 
> > 
> > The first one is in the queryFont() routine. Find the lines ...
> > 
> >     if id = Printer then
> >         -- use the printer's dc
> >         useId = Printer
> > 
> > and add this line before them ...
> >     saved = {}
> > 
> > and these lines after them ...
> > 
> >     elsif window_type[id] = Pixmap then
> >         useId = id
> > 
> > Then find the lines ...
> > 
> >     if useId != Printer then
> >         -- restore the font attributes
> >         window_font[useId] = saved
> > 
> > and replace them with ...
> > 
> >     if length(saved) != 0 then
> >         -- restore the font attributes
> >         window_font[useId] = saved  
> > 
> > 
> > The second error is in the trackObject() routine.
> > In the routine trackObject() find the lines ...
> > 
> >         if heldResource[at][ResOwner] = owner then
> >             heldResource[at][ResCnt] += 1
> > 
> > and add after them these lines...
> > 
> >         elsif heldResource[at][ResOwner] = -1 then
> >             -- This resource now has an owner.
> >             heldResource[at][ResOwner] = owner
> > 
> > Okay, try it now!
> > 
> Derek,
> 
> That took care of those demos.  The only other demo that crashed was
> childw2.

Yeah, I was a but suspicious about that fix. It looked too simplistic. The
problem is with queryFont(). I've now made a much better fix but it 
involved a lot of code changing; too much for a simple patch. So I'll
release the fix in v0.60.4 later today, along with a couple of others.

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu