ID:107176
 
Not a bug
BYOND Version:479
Operating System:Windows Vista Home Premium 64-bit
Web Browser:Firefox 3.6.13
Applies to:Dream Maker
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
In the GC reference it clearly states:
Mobs with a non-empty key and all objects with non-empty tags are also immortal.

Numbered Steps to Reproduce Problem:

Create a new object that handles a Click().
Give it a tag
Place it in a Grid (it's what I do anyway)
Click it.
Does nothing.

Code Snippet:
CustomNew(mob/M)
tag=M
..()


Expected Results:

Object doesn't get garbage collected

Actual Results:
It does

Now when adding it to a list:

Code Snippet:
var/list/GarbageList = new

CustomNew(mob/M)
GarbageList=M
..()


Expected Results:

Object doesn't get garbage collected

Actual Results:
Works fine

When does the problem NOT occur?

When setting a reference to the obj other than Tag
Have you tried this with a real tag? The tag var isn't supposed to take a mob, so it may simply not be assigning anything. Also, a tag is meant to be unique, and that too could be getting in your way if you're assigning the same tag to multiple objects. If either of these is the case, then this is not a bug.

However with grids and statpanels my advice is always to use a reference anyway.
You are correct, assigning it a random value will work as expected.

I wasn't aware tags should be exclusive.

Fixed. Cheers for the fast response Lummox.