[Bf-committers] [Bf-blender-cvs] [1e09685] master: Commit D31 : Check if the user count needs to be decreased after adding a new BI image texture.

Thomas Beck software at plasmasolutions.de
Mon Nov 25 09:05:59 CET 2013


Hi Sergey,

1) I just wanted to make sure that I don't break anything <before>
committing.. Is it possible to push the code while not having it <active>
yet?
As I understood it:
- Differential: For a review before a commit
- Manifest: Tasks preparation and Bugs
- Audit: For a review after a commit (when you are sure it does not break
smth. but want to make it aware to other devs)
Is that wrong?

2) I simply didn't know the id_us_min(). Will change that!

Greetings, Thomas


2013/11/25 Sergey Sharybin <sergey.vfx at gmail.com>

> Some comments as well.
>
> 1. Why not use post-push code audit tool at developer.b.o?
> 2. Would rather use id_us_min() instead of manual id user decrement.
> Additional checks there helps tracking what's going on when we've got
> user counter errors.
>
> On Mon, Nov 25, 2013 at 5:43 AM, Campbell Barton <ideasman42 at gmail.com>
> wrote:
> > Comments like this are obvious/redundant IMHO,
> >  "Decrease the previous image users count by 1", "Assign the new image"
> > - its very obvious whats being done without any comments.
> >
> > On Mon, Nov 25, 2013 at 12:07 AM, Thomas Beck <noreply at git.blender.org>
> wrote:
> >> Commit: 1e096852bf38f8d7b9bdb93d9a5f1e585b87db05
> >> Author: Thomas Beck
> >> Date:   Sun Nov 24 13:54:47 2013 +0100
> >> http://developer.blender.org/rB1e096852bf38f8d7b9bdb93d9a5f1e585b87db05
> >>
> >> Commit D31 : Check if the user count needs to be decreased after adding
> a new BI image texture.
> >>
> >> Fixes this problem:
> >>
> >> *Go to the Blender (BI) textures tab and open an existing image.
> >> *Hit on the plus sign next to datablock to create a new image.
> >> *Complete the creation process and switch back to the first (loaded)
> image.
> >> -> The image user count raises... will raise as often as you hit the
> plus sign
> >>
> >> ===================================================================
> >>
> >> M       source/blender/editors/space_image/image_ops.c
> >>
> >> ===================================================================
> >>
> >> diff --git a/source/blender/editors/space_image/image_ops.c
> b/source/blender/editors/space_image/image_ops.c
> >> index b7d3407..58d835b 100644
> >> --- a/source/blender/editors/space_image/image_ops.c
> >> +++ b/source/blender/editors/space_image/image_ops.c
> >> @@ -1792,7 +1792,9 @@ static int image_new_exec(bContext *C, wmOperator
> *op)
> >>         else {
> >>                 Tex *tex = CTX_data_pointer_get_type(C, "texture",
> &RNA_Texture).data;
> >>                 if (tex && tex->type == TEX_IMAGE) {
> >> -                       tex->ima = ima;
> >> +                       if (tex->ima)
> >> +                               tex->ima->id.us--;      /* Decrease the
> previous image users count by 1 */
> >> +                       tex->ima = ima;                 /* Assign the
> new image */
> >>                         ED_area_tag_redraw(CTX_wm_area(C));
> >>                 }
> >>         }
> >>
> >> _______________________________________________
> >> Bf-blender-cvs mailing list
> >> Bf-blender-cvs at blender.org
> >> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
> >
> >
> >
> > --
> > - Campbell
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-committers
>
>
>
> --
> With best regards, Sergey Sharybin
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>
>


-- 

------
Plasmasolutions
Design | Development | Training

Website: Http://www.plasmasolutions.de <http://www.plasmasolutions.de/>
Blog: Http://blog.plasmasolutions.de <http://blog.plasmasolutions.de/>

Telefon: 0176 2017 9565


More information about the Bf-committers mailing list