// File: enbock[P]Warp10Server/ulib/src/EventDispatcher.cpp
// Function: u::EventDispatcher::~EventDispatcher()
u::EventDispatcher::~EventDispatcher()
{
	int8 c = 0;
	lock();
	/*
	 * Be so long alive, so long any bindings exists.
	 * DO A CLEAN PROGRMMING!
	 */
	while(hasEventListener())
	{
#ifndef NDEBUG
		if(c == 0) 
			error(className()+": Has "+int2string(_eventList.length())+" binder types.");
#endif
		int64 i,l;
		for(i=0, l=_eventList.length(); i<l; i++)
		{
			_eventVector* vec = &_eventList.at(i);
#ifndef NDEBUG
			if(c == 0)
			{
				String out = className() + ": Bind type " + int2string(i) + " is "
					+ (*vec->type) + " with "	+ int2string(vec->list.length())
					+ " binder" + (vec->list.length() > 1 ? "s" : "")
					+ " on target";
#endif
			  int64 vl, vi;
			  for(vi=0, vl = vec->list.length(); vi < vl; vi++)
			  {
			  	// autoremove on invalid target
			  	if(!valid((Object *)&(vec->list.at(vi).target)))
			  	{
#ifndef NDEBUG
			  		trace(
			  			className() + "::~EventDispatcher: Remove target "
			  			+ ptr2string(vec->list.at(vi).target) + " from list "
			  			+ (*vec->type)
					);
#endif
			  		vec->list.erase(vi);
			  		vl = vec->list.length();
			  		if(vl > 0) vi--;
			  		if(vec->list.empty())
			  		{
			  			delEventVector(vec->type);
			  			l = _eventList.length();
			  			if (l > 0) i--;
			  			break;
			  		}
			  	}
#ifndef NDEBUG
			  	else
			  	{
			  		out += " "+int2string(vi)+": "+vec->list.at(vi).target->toString();
				  	if(vi+1 != vl) out += " and";
			  	}
#endif
			  }
#ifndef NDEBUG
			  trace(out+".");
			}
#endif
		}
		unlock();
#ifndef NDEBUG
		c++;
		if(c>=90) c=0;
#endif
		usleep(1000000/FPS);
		lock();
	}
	unlock();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x720, %rsp            # imm = 0x720
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x658(%rbp)
leaq 0x20766f(%rip), %rax    # 0x60f6c0
movq %rax, (%rdi)
movb $0x0, -0x9(%rbp)
callq 0x40d7d0
jmp 0x40805f
jmp 0x408061
movq -0x658(%rbp), %rdi
callq 0x408bd0
movb %al, -0x659(%rbp)
jmp 0x408075
movb -0x659(%rbp), %al
testb $0x1, %al
jne 0x408084
jmp 0x408b8a
movsbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jne 0x40827e
movq $0x61a580, %rdi         # imm = 0x61A580
leaq 0x197126(%rip), %rsi    # 0x59f1c5
callq 0x47dcd0
movq %rax, -0x668(%rbp)
jmp 0x4080ad
movb $0x0, -0xc9(%rbp)
movb $0x0, -0xca(%rbp)
movb $0x0, -0x129(%rbp)
movb $0x0, -0x12a(%rbp)
movb $0x0, -0x12c(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x4080db
jmp 0x408187
movq -0x658(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0xc8(%rbp), %rdi
callq *%rax
jmp 0x4080f4
movb $0x1, -0xc9(%rbp)
leaq -0x90(%rbp), %rsi
leaq 0x19710a(%rip), %rdx    # 0x59f213
leaq -0x70(%rbp), %rdi
callq 0x405740
jmp 0x408114
movq -0x658(%rbp), %rdi
movb $0x1, -0xca(%rbp)
addq $0x38, %rdi
callq 0x409a70
movq %rax, -0x670(%rbp)
jmp 0x408134
movq -0x670(%rbp), %rax
movl %eax, %esi
leaq -0x128(%rbp), %rdi
callq 0x40dc60
jmp 0x40814b
movb $0x1, -0x129(%rbp)
leaq -0xf0(%rbp), %rdx
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x407710
jmp 0x408168
movb $0x1, -0x12a(%rbp)
leaq 0x1970a4(%rip), %rdx    # 0x59f21a
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x405740
jmp 0x408185
jmp 0x4081bc
leaq -0x12b(%rbp), %rdi
movq %rdi, -0x678(%rbp)
callq 0x415b00
movq -0x678(%rbp), %rdx
movb $0x1, -0x12c(%rbp)
leaq 0x1b68db(%rip), %rsi    # 0x5bea8a
leaq -0x30(%rbp), %rdi
callq 0x405e40
jmp 0x4081ba
jmp 0x4081bc
movq -0x668(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x490550
movq %rax, -0x680(%rbp)
jmp 0x4081d5
movq -0x680(%rbp), %rdi
leaq 0x196eb8(%rip), %rsi    # 0x59f09b
callq 0x47dcd0
movq %rax, -0x688(%rbp)
jmp 0x4081f1
movq -0x688(%rbp), %rdi
movq $0x47d5b0, %rsi         # imm = 0x47D5B0
callq 0x47c7c0
jmp 0x408206
leaq -0x30(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x12c(%rbp)
jne 0x40821a
jmp 0x408226
leaq -0x12b(%rbp), %rdi
callq 0x415b20
testb $0x1, -0x12a(%rbp)
jne 0x408231
jmp 0x40823a
leaq -0x50(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x129(%rbp)
jne 0x408245
jmp 0x408251
leaq -0x128(%rbp), %rdi
callq 0x404d10
testb $0x1, -0xca(%rbp)
jne 0x40825c
jmp 0x408265
leaq -0x70(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0xc9(%rbp)
jne 0x408270
jmp 0x40827c
leaq -0xc8(%rbp), %rdi
callq 0x404d10
jmp 0x40827e
movq -0x658(%rbp), %rdi
movq $0x0, -0x138(%rbp)
addq $0x38, %rdi
callq 0x409a70
movq %rax, -0x690(%rbp)
jmp 0x4082a2
movq -0x690(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x138(%rbp), %rax
cmpq -0x140(%rbp), %rax
jge 0x408b48
movq -0x658(%rbp), %rdi
addq $0x70, %rdi
movq -0x138(%rbp), %rsi
callq 0x409a90
movq %rax, -0x698(%rbp)
jmp 0x4082e4
movq -0x698(%rbp), %rax
movq %rax, -0x148(%rbp)
movsbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jne 0x408b2f
movq -0x658(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x318(%rbp), %rdi
callq *%rax
jmp 0x408318
leaq -0x2e0(%rbp), %rsi
leaq 0x196f03(%rip), %rdx    # 0x59f229
leaq -0x2c0(%rbp), %rdi
callq 0x405740
jmp 0x408334
movl -0x138(%rbp), %esi
leaq -0x370(%rbp), %rdi
callq 0x40dc60
jmp 0x408348
leaq -0x338(%rbp), %rdx
leaq -0x2a0(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x407710
jmp 0x408364
leaq 0x196ecb(%rip), %rdx    # 0x59f236
leaq -0x280(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x405740
jmp 0x408380
movq -0x148(%rbp), %rax
movq (%rax), %rdx
addq $0x38, %rdx
leaq -0x260(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x409ad0
jmp 0x4083a3
leaq 0x196e91(%rip), %rdx    # 0x59f23b
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x405740
jmp 0x4083bf
movq -0x148(%rbp), %rdi
addq $0x8, %rdi
callq 0x409b20
movq %rax, -0x6a0(%rbp)
jmp 0x4083d8
movq -0x6a0(%rbp), %rax
movl %eax, %esi
leaq -0x3c8(%rbp), %rdi
callq 0x40dc60
jmp 0x4083ef
leaq -0x390(%rbp), %rdx
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x407710
jmp 0x40840b
leaq 0x196e30(%rip), %rdx    # 0x59f242
leaq -0x200(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x405740
jmp 0x408427
movq -0x148(%rbp), %rdi
addq $0x8, %rdi
callq 0x409b20
movq %rax, -0x6a8(%rbp)
jmp 0x408440
movq -0x6a8(%rbp), %rax
subq $0x2, %rax
leaq 0x1b97bd(%rip), %rax    # 0x5c1c0f
leaq 0x1b6631(%rip), %rdx    # 0x5bea8a
cmovgeq %rax, %rdx
leaq -0x1e0(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x405740
jmp 0x408472
leaq 0x196dd1(%rip), %rdx    # 0x59f24a
leaq -0x1c0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x405740
jmp 0x40848e
leaq -0x1a0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x40e0a0
jmp 0x4084a3
leaq -0x1c0(%rbp), %rdi
callq 0x48dbd0
leaq -0x1e0(%rbp), %rdi
callq 0x48dbd0
leaq -0x200(%rbp), %rdi
callq 0x48dbd0
leaq -0x220(%rbp), %rdi
callq 0x48dbd0
leaq -0x3c8(%rbp), %rdi
callq 0x404d10
leaq -0x240(%rbp), %rdi
callq 0x48dbd0
leaq -0x260(%rbp), %rdi
callq 0x48dbd0
leaq -0x280(%rbp), %rdi
callq 0x48dbd0
leaq -0x2a0(%rbp), %rdi
callq 0x48dbd0
leaq -0x370(%rbp), %rdi
callq 0x404d10
leaq -0x2c0(%rbp), %rdi
callq 0x48dbd0
leaq -0x318(%rbp), %rdi
callq 0x404d10
movq $0x0, -0x3d8(%rbp)
movq -0x148(%rbp), %rdi
addq $0x8, %rdi
callq 0x409b20
movq %rax, -0x6b0(%rbp)
jmp 0x408557
movq -0x6b0(%rbp), %rax
movq %rax, -0x3d0(%rbp)
movq -0x3d8(%rbp), %rax
cmpq -0x3d0(%rbp), %rax
jge 0x408a32
movq -0x148(%rbp), %rdi
addq $0x40, %rdi
movq -0x3d8(%rbp), %rsi
callq 0x409b40
movq %rax, -0x6b8(%rbp)
jmp 0x408599
movq -0x6b8(%rbp), %rdi
addq $0x38, %rdi
callq 0x40eea0
movb %al, -0x6b9(%rbp)
jmp 0x4085b1
movb -0x6b9(%rbp), %al
testb $0x1, %al
jne 0x4088f6
jmp 0x4085c1
movq $0x61a6a0, %rdi         # imm = 0x61A6A0
leaq 0x196aaa(%rip), %rsi    # 0x59f079
callq 0x47dcd0
movq %rax, -0x6c8(%rbp)
jmp 0x4085dd
movb $0x0, -0x4b1(%rbp)
movb $0x0, -0x4b2(%rbp)
movb $0x0, -0x511(%rbp)
movb $0x0, -0x512(%rbp)
movb $0x0, -0x513(%rbp)
movb $0x0, -0x515(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x408612
jmp 0x408700
movq -0x658(%rbp), %rsi
movq (%rsi), %rax
movq 0x8(%rax), %rax
leaq -0x4b0(%rbp), %rdi
callq *%rax
jmp 0x40862b
movb $0x1, -0x4b1(%rbp)
leaq -0x478(%rbp), %rsi
leaq 0x196c8d(%rip), %rdx    # 0x59f2cd
leaq -0x458(%rbp), %rdi
callq 0x405740
jmp 0x40864e
movb $0x1, -0x4b2(%rbp)
movq -0x148(%rbp), %rdi
addq $0x40, %rdi
movq -0x3d8(%rbp), %rsi
callq 0x409b40
movq %rax, -0x6d0(%rbp)
jmp 0x408675
movq -0x6d0(%rbp), %rax
movq 0x38(%rax), %rsi
leaq -0x510(%rbp), %rdi
callq 0x40dd50
jmp 0x40868e
movb $0x1, -0x511(%rbp)
leaq -0x4d8(%rbp), %rdx
leaq -0x438(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0x407710
jmp 0x4086b1
movb $0x1, -0x512(%rbp)
leaq 0x196c31(%rip), %rdx    # 0x59f2f0
leaq -0x418(%rbp), %rdi
leaq -0x438(%rbp), %rsi
callq 0x405740
jmp 0x4086d4
movb $0x1, -0x513(%rbp)
movq -0x148(%rbp), %rax
movq (%rax), %rdx
addq $0x38, %rdx
leaq -0x3f8(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0x409ad0
jmp 0x4086fe
jmp 0x408738
leaq -0x514(%rbp), %rdi
movq %rdi, -0x6d8(%rbp)
callq 0x415b00
movq -0x6d8(%rbp), %rdx
movb $0x1, -0x515(%rbp)
leaq 0x1b6362(%rip), %rsi    # 0x5bea8a
leaq -0x3f8(%rbp), %rdi
callq 0x405e40
jmp 0x408736
jmp 0x408738
movq -0x6c8(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x490550
movq %rax, -0x6e0(%rbp)
jmp 0x408754
movq -0x6e0(%rbp), %rdi
leaq 0x196939(%rip), %rsi    # 0x59f09b
callq 0x47dcd0
movq %rax, -0x6e8(%rbp)
jmp 0x408770
movq -0x6e8(%rbp), %rdi
movq $0x47d5b0, %rsi         # imm = 0x47D5B0
callq 0x47c7c0
jmp 0x408785
leaq -0x3f8(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x515(%rbp)
jne 0x40879c
jmp 0x4087a8
leaq -0x514(%rbp), %rdi
callq 0x415b20
testb $0x1, -0x513(%rbp)
jne 0x4087b3
jmp 0x4087bf
leaq -0x418(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x512(%rbp)
jne 0x4087ca
jmp 0x4087d6
leaq -0x438(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x511(%rbp)
jne 0x4087e1
jmp 0x4087ed
leaq -0x510(%rbp), %rdi
callq 0x404d10
testb $0x1, -0x4b2(%rbp)
jne 0x4087f8
jmp 0x408804
leaq -0x458(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x4b1(%rbp)
jne 0x40880f
jmp 0x40881b
leaq -0x4b0(%rbp), %rdi
callq 0x404d10
movq -0x148(%rbp), %rdi
addq $0x8, %rdi
movq -0x3d8(%rbp), %rsi
callq 0x409b80
jmp 0x408834
movq -0x148(%rbp), %rdi
addq $0x8, %rdi
callq 0x409b20
movq %rax, -0x6f0(%rbp)
jmp 0x40884d
movq -0x6f0(%rbp), %rax
movq %rax, -0x3d0(%rbp)
cmpq $0x0, -0x3d0(%rbp)
jle 0x408877
movq -0x3d8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x3d8(%rbp)
movq -0x148(%rbp), %rdi
addq $0x8, %rdi
addq $0x38, %rdi
callq 0x409bf0
testb $0x1, %al
jne 0x408891
jmp 0x4088f1
movq -0x658(%rbp), %rdi
movq -0x148(%rbp), %rax
movq (%rax), %rsi
callq 0x408c00
jmp 0x4088a9
movq -0x658(%rbp), %rdi
addq $0x38, %rdi
callq 0x409a70
movq %rax, -0x6f8(%rbp)
jmp 0x4088c2
movq -0x6f8(%rbp), %rax
movq %rax, -0x140(%rbp)
cmpq $0x0, -0x140(%rbp)
jle 0x4088ec
movq -0x138(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x138(%rbp)
jmp 0x408a32
jmp 0x408a19
movl -0x3d8(%rbp), %esi
leaq -0x5d0(%rbp), %rdi
callq 0x40dc60
jmp 0x40890a
leaq -0x598(%rbp), %rdx
leaq 0x19704a(%rip), %rsi    # 0x59f962
leaq -0x578(%rbp), %rdi
callq 0x405790
jmp 0x408926
leaq 0x19ada1(%rip), %rdx    # 0x5a36ce
leaq -0x558(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0x405740
jmp 0x408942
movq -0x148(%rbp), %rdi
addq $0x40, %rdi
movq -0x3d8(%rbp), %rsi
callq 0x409b40
movq %rax, -0x700(%rbp)
jmp 0x408962
movq -0x700(%rbp), %rax
movq 0x38(%rax), %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0x628(%rbp), %rdi
callq *%rax
jmp 0x40897f
leaq -0x5f0(%rbp), %rdx
leaq -0x538(%rbp), %rdi
leaq -0x558(%rbp), %rsi
callq 0x407710
jmp 0x40899b
leaq -0x168(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x48f2f0
jmp 0x4089b0
leaq -0x538(%rbp), %rdi
callq 0x48dbd0
leaq -0x628(%rbp), %rdi
callq 0x404d10
leaq -0x558(%rbp), %rdi
callq 0x48dbd0
leaq -0x578(%rbp), %rdi
callq 0x48dbd0
leaq -0x5d0(%rbp), %rdi
callq 0x404d10
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
cmpq -0x3d0(%rbp), %rax
je 0x408a17
leaq -0x168(%rbp), %rdi
leaq 0x1968ee(%rip), %rsi    # 0x59f2fc
callq 0x48f3d0
jmp 0x408a15
jmp 0x408a17
jmp 0x408a19
jmp 0x408a1b
movq -0x3d8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3d8(%rbp)
jmp 0x408565
movq $0x61a6a0, %rdi         # imm = 0x61A6A0
leaq 0x196639(%rip), %rsi    # 0x59f079
callq 0x47dcd0
movq %rax, -0x708(%rbp)
jmp 0x408a4e
movb $0x0, -0x64a(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x408a5d
jmp 0x408a7b
leaq -0x168(%rbp), %rsi
leaq 0x19ad62(%rip), %rdx    # 0x5a37cd
leaq -0x648(%rbp), %rdi
callq 0x409c30
jmp 0x408a79
jmp 0x408ab3
leaq -0x649(%rbp), %rdi
movq %rdi, -0x710(%rbp)
callq 0x415b00
movq -0x710(%rbp), %rdx
movb $0x1, -0x64a(%rbp)
leaq 0x1b5fe7(%rip), %rsi    # 0x5bea8a
leaq -0x648(%rbp), %rdi
callq 0x405e40
jmp 0x408ab1
jmp 0x408ab3
movq -0x708(%rbp), %rdi
leaq -0x648(%rbp), %rsi
callq 0x490550
movq %rax, -0x718(%rbp)
jmp 0x408acf
movq -0x718(%rbp), %rdi
leaq 0x1965be(%rip), %rsi    # 0x59f09b
callq 0x47dcd0
movq %rax, -0x720(%rbp)
jmp 0x408aeb
movq -0x720(%rbp), %rdi
movq $0x47d5b0, %rsi         # imm = 0x47D5B0
callq 0x47c7c0
jmp 0x408b00
leaq -0x648(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x64a(%rbp)
jne 0x408b17
jmp 0x408b23
leaq -0x649(%rbp), %rdi
callq 0x415b20
leaq -0x1a0(%rbp), %rdi
callq 0x404d10
jmp 0x408b31
movq -0x138(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x138(%rbp)
jmp 0x4082b0
movq -0x658(%rbp), %rdi
callq 0x40d740
jmp 0x408b56
movb -0x9(%rbp), %al
addb $0x1, %al
movb %al, -0x9(%rbp)
movsbl -0x9(%rbp), %eax
cmpl $0x5a, %eax
jl 0x408b6b
movb $0x0, -0x9(%rbp)
movl $0x2b67, %edi           # imm = 0x2B67
callq 0x547660
jmp 0x408b77
movq -0x658(%rbp), %rdi
callq 0x40d7d0
jmp 0x408b85
jmp 0x408061
movq -0x658(%rbp), %rdi
callq 0x40d740
jmp 0x408b98
movq -0x658(%rbp), %rdi
addq $0x38, %rdi
callq 0x409a40
movq -0x658(%rbp), %rdi
callq 0x40d9a0
addq $0x720, %rsp            # imm = 0x720
popq %rbp
retq
movq %rax, %rdi
callq 0x405580
nopw %cs:(%rax,%rax)