ID:2223744
 
Code:
proc/RemoveFromDeckEditor(var/card/A,var/mob/D)

if(A in D.DE_main_deck)
D.CleanDEList(D)
D.DE_main_deck -= A

if(A in D.DE_side_deck)
D.CleanDEList(D)
D.DE_side_deck -= A

if(A in D.DE_extra_deck)
D.CleanDEList(D)
D.DE_extra_deck -= A

D.ShowActiveList(D)


Problem description:
All the procs work correctly but sometimes there is an off chance, the code will not call the final proc and I know this because I have debug messages in each of the procs saying if they are starting or not. On this random chance, the final proc (D.ShowActiveList(D)) will not start at all but I've put no sleep() or returns anywhere within the code. I'm really confused as to why this is happening with no apparent explanation.
My first instinct is that you're running a loop that isn't closing itself in CleanDEList(). I would suggest throwing debug messages inside of CleanDEList() and seeing where it gets stuck. Also, if you haven't already, add:

#define DEBUG 1


to your code to see if you're getting any runtime errors.
I am not getting any run time errors and my DEBUG is already set on.
Could you post the CleanDEList() proc?
    CleanDEList(var/mob/D)
world.log << "Clearing List"
for(var/screen_ref/T in D.client.screen)
if(findtext(T.screen_loc,"list:"))
Clean(T)
continue


Clean() is essentially del but it checks if the reference that it's given is valid.
I have fixed the issue. For some reason, it did a if branch if it was over the same control as itself. Made a check after Mouse Drag was activated to see if the control is over the same control and if it was to end the code immediately.