Plugins 2

Patrick Julien freak at codepimps.org
Thu Feb 12 15:24:02 CET 2004


Another thing I did not notice is the usage of image #0.

When newing up KisTileCommand, use lay.get() instead of casting.  This problem 
is caused by missing features in KSharedPtr.


On February 11, 2004 09:33 am, Cyrille Berger wrote:
> Hello,
> So I learn how to do a patch, I hope it has worked :)
> I tried to implement everything you said about the first version, but I
> have two problems :

Is this on the first call of ktm -> tile(...)?  It seems to be since the tile 
number is 0, but the answer could always suprise me.  Your problem seems to 
be about overwritten memory, see details below.  You may want to try running 
the loop first without doing any modifications to the tile.

>  - when I do	tile = ktm->tile( i, TILEMODE_RW)), then krita crash I don't
> know what I made wrong, I think I am doing like in the rest of the program,
> when I look in the backtrace of the crash handler, I get this :

Not sure what is going here, the tile number being passed to detach is 
-1073748304, obviously, this isn't good.

KisTileMediatorSingleton(this) is null here, hence a segault.

>
> #6  0x40aa70a6 in KisTileMediatorSingleton::detach(KSharedPtr<KisTile>,
> KSharedPtr<KisTileMgr>, int) (this=0x0, tile={ptr = 0x8221828}, mgr={ptr =
> 0x8221678},
>     tilenum=0) at kistilemediator.cpp:121

tilnum is -1073748304, but the parameter is passed from KisTileMgr to 
KisTileMediator directly without modification.  Not sure what happened there.

> #7  0x40aa6c33 in KisTileMediator::detach(KSharedPtr<KisTile>,
> KSharedPtr<KisTileMgr>, int) (this=0x81813a0, tile={ptr = 0x8221828},
> mgr={ptr = 0x8221828},
>     tilenum=-1073748304) at ksharedptr.h:61

tilnum is 0.

> #8  0x40aa9334 in KisTileMgr::detach(KSharedPtr<KisTile>, int, bool) (
>     this=0x8221678, tile={ptr = 0x8221828}, tilenum=0) at ksharedptr.h:61

tilnum is 0.

> #9  0x40aa9a24 in KisTileMgr::tile(int, int) (this=0x8221678, tilenum=0,
>     mode=3) at ksharedptr.h:61
>
> Do you have an idea of what I am doing wrong ?
>
>  - and it looks like there is always an alpha channel, even if it's not
> used, is it normal ?

I actually don't remeber this bit well enough to give a proper answer.  I 
would need to look at the code.

However, no, we should be able to do remove the alpha channel from memory is 
there isn't any.


More information about the kimageshop mailing list