ID:1821580
 
Resolved
Calling image() did not call the New() proc, if overridden, for the /image type. Deleting images, either directly or via garbage collection, also did not call Del().
BYOND Version:507
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 41.0.2272.101
Applies to:Dream Daemon
Status: Resolved (507.1280)

This issue has been resolved.
Descriptive Problem Summary:

Nix discovered this one last night: I only fixed his code after I figured out why it was happening.

DM allows you to override image objects, but unfortunately, New() and Del() overrides are never actually called. They just silently fail.

Also, I've been unable to replicate the issue in a blank project, but Nix and I noticed that his project had a progressively worsening leak. The issue was related to using image objects as overlays. They were socked away into a global list and then the global list was assigned to an overlays list. I'm not at all sure how to reproduce it, but we basically discovered in some rare cases, Images were not being deleted despite being instructed to be explicitly deleted.

Code Snippet (if applicable) to Reproduce Problem:

var/imagecounter = 0

image
Del()
imagecounter--
..()
New()
imagecounter++
..()


Expected Results:

You should see imagecounter increasing and decreasing with the number of images in the world.

Actual Results:

Imagecounter never increases or decreases at all.
Hmm. Just looking at the code, this doesn't make any sense. I'm seeing that the exact same code that handles a call to New() for atoms will do so for images, and there's no difference in the flow that would explain it. Haven't taken another look at Del() but I expect to find much the same. I'll look into this further; I may need a test case but I'll see what I can find out.
Wow, this was a really good find.

It appears New() is called for images only when using the new operator, not the image() proc, which is obviously incorrect behavior. And Del() wasn't being called at all.
Lummox JR resolved issue with message:
Calling image() did not call the New() proc, if overridden, for the /image type. Deleting images, either directly or via garbage collection, also did not call Del().
Thanks Lummox... I've got another weird one for you in a minute too. Attempting to reproduce the issue now.

EDIT: Nevermind, it's intended behavior, albeit extremely vexing intended behavior.