image_field_insert() calls image_field_update() which calls file_field_update()

wtf 1: file_field_update() tries to return early when $entity->revision is set, shame that's only for nodes, not all entities.

wtf 2: Check for files that have been removed from the object.

yet this is called from image_field_insert().

Also there's no file_field_insert() at all. Due to the node_load($nid) here, this causes a memory leak when inserting lots of content with image fields attached, since no other code loads nodes when they're saved the first time.

CommentFileSizeAuthor
image_field_insert_die.patch785 bytescatch

Comments

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

nice deletion.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

catch’s picture

Status: Fixed » Closed (fixed)
Issue tags: -Performance, -DIE

Automatically closed -- issue fixed for 2 weeks with no activity.