问:
crash on EXC_BAD_ACCESS error on dismiss view controller in WebRTC library
I am using webRTC framework for audio call in my application. After dismissing call view controller I am getting the following error on App delegate.

Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)

Following is the screenshot of xcode

Following is the stack trace

```CallViewController.__ivar_destroyer:
0x101d2c780 <+0>:    pushq  %rbp
0x101d2c781 <+1>:    movq   %rsp, %rbp
0x101d2c784 <+4>:    subq   $0x20, %rsp
0x101d2c788 <+8>:    movq   %rdi, %rax
0x101d2c78b <+11>:   movq   %rax, -0x8(%rbp)
0x101d2c78f <+15>:   movq   0x16dfb02(%rip), %rax     ; direct field offset for GopChat.CallViewController.(ws in _024208FCD932FF59905765BE8E3FA1C3) : SwiftWebSocket.WebSocket
0x101d2c796 <+22>:   movq   (%rdi,%rax), %rax
0x101d2c79a <+26>:   movq   %rdi, -0x10(%rbp)
0x101d2c79e <+30>:   movq   %rax, %rdi
0x101d2c7a1 <+33>:   movq   %rsi, -0x18(%rbp)
0x101d2c7a5 <+37>:   callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7aa <+42>:   movq   0x16defcf(%rip), %rax     ; direct field offset for GopChat.CallViewController.reachability : __ObjC.Reachability
0x101d2c7b1 <+49>:   movq   -0x10(%rbp), %rsi
0x101d2c7b5 <+53>:   movq   (%rsi,%rax), %rdi
0x101d2c7b9 <+57>:   callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7be <+62>:   movq   0x16defc3(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnBack : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c7c5 <+69>:   movq   -0x10(%rbp), %rsi
0x101d2c7c9 <+73>:   movq   (%rsi,%rax), %rdi
0x101d2c7cd <+77>:   callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7d2 <+82>:   movq   0x16defb7(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblTopicWait : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c7d9 <+89>:   movq   -0x10(%rbp), %rsi
0x101d2c7dd <+93>:   movq   (%rsi,%rax), %rdi
0x101d2c7e1 <+97>:   callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7e6 <+102>:  movq   0x16defab(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblMessageWait : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c7ed <+109>:  movq   -0x10(%rbp), %rsi
0x101d2c7f1 <+113>:  movq   (%rsi,%rax), %rdi
0x101d2c7f5 <+117>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7fa <+122>:  movq   0x16def9f(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgWait : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c801 <+129>:  movq   -0x10(%rbp), %rsi
0x101d2c805 <+133>:  movq   (%rsi,%rax), %rdi
0x101d2c809 <+137>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c80e <+142>:  movq   0x16def93(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewWaiting : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c815 <+149>:  movq   -0x10(%rbp), %rsi
0x101d2c819 <+153>:  movq   (%rsi,%rax), %rdi
0x101d2c81d <+157>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c822 <+162>:  movq   0x16def87(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewBeforeCall : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c829 <+169>:  movq   -0x10(%rbp), %rsi
0x101d2c82d <+173>:  movq   (%rsi,%rax), %rdi
0x101d2c831 <+177>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c836 <+182>:  movq   0x16def7b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAlpha : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c83d <+189>:  movq   -0x10(%rbp), %rsi
0x101d2c841 <+193>:  movq   (%rsi,%rax), %rdi
0x101d2c845 <+197>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c84a <+202>:  movq   0x16def6f(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblTopic : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c851 <+209>:  movq   -0x10(%rbp), %rsi
0x101d2c855 <+213>:  movq   (%rsi,%rax), %rdi
0x101d2c859 <+217>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c85e <+222>:  movq   0x16def63(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblTime : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c865 <+229>:  movq   -0x10(%rbp), %rsi
0x101d2c869 <+233>:  movq   (%rsi,%rax), %rdi
0x101d2c86d <+237>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c872 <+242>:  movq   0x16def57(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnHangup : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c879 <+249>:  movq   -0x10(%rbp), %rsi
0x101d2c87d <+253>:  movq   (%rsi,%rax), %rdi
0x101d2c881 <+257>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c886 <+262>:  movq   0x16def4b(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnMicrophone : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c88d <+269>:  movq   -0x10(%rbp), %rsi
0x101d2c891 <+273>:  movq   (%rsi,%rax), %rdi
0x101d2c895 <+277>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c89a <+282>:  movq   0x16def3f(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnSpeaker : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c8a1 <+289>:  movq   -0x10(%rbp), %rsi
0x101d2c8a5 <+293>:  movq   (%rsi,%rax), %rdi
0x101d2c8a9 <+297>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8ae <+302>:  movq   0x16def33(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnNext : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c8b5 <+309>:  movq   -0x10(%rbp), %rsi
0x101d2c8b9 <+313>:  movq   (%rsi,%rax), %rdi
0x101d2c8bd <+317>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8c2 <+322>:  movq   0x16def27(%rip), %rax     ; direct field offset for GopChat.CallViewController.stackViewCalls : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIStackView>
0x101d2c8c9 <+329>:  movq   -0x10(%rbp), %rsi
0x101d2c8cd <+333>:  movq   (%rsi,%rax), %rdi
0x101d2c8d1 <+337>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8d6 <+342>:  movq   0x16def1b(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewCall1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c8dd <+349>:  movq   -0x10(%rbp), %rsi
0x101d2c8e1 <+353>:  movq   (%rsi,%rax), %rdi
0x101d2c8e5 <+357>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8ea <+362>:  movq   0x16def0f(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewCall2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c8f1 <+369>:  movq   -0x10(%rbp), %rsi
0x101d2c8f5 <+373>:  movq   (%rsi,%rax), %rdi
0x101d2c8f9 <+377>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8fe <+382>:  movq   0x16def03(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewCall3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c905 <+389>:  movq   -0x10(%rbp), %rsi
0x101d2c909 <+393>:  movq   (%rsi,%rax), %rdi
0x101d2c90d <+397>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c912 <+402>:  movq   0x16deef7(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewCall4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c919 <+409>:  movq   -0x10(%rbp), %rsi
0x101d2c91d <+413>:  movq   (%rsi,%rax), %rdi
0x101d2c921 <+417>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c926 <+422>:  movq   0x16deeeb(%rip), %rax     ; direct field offset for GopChat.CallViewController.webv1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIWebView>
0x101d2c92d <+429>:  movq   -0x10(%rbp), %rsi
0x101d2c931 <+433>:  movq   (%rsi,%rax), %rdi
0x101d2c935 <+437>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c93a <+442>:  movq   0x16deedf(%rip), %rax     ; direct field offset for GopChat.CallViewController.webv2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIWebView>
0x101d2c941 <+449>:  movq   -0x10(%rbp), %rsi
0x101d2c945 <+453>:  movq   (%rsi,%rax), %rdi
0x101d2c949 <+457>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c94e <+462>:  movq   0x16deed3(%rip), %rax     ; direct field offset for GopChat.CallViewController.webv3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIWebView>
0x101d2c955 <+469>:  movq   -0x10(%rbp), %rsi
0x101d2c959 <+473>:  movq   (%rsi,%rax), %rdi
0x101d2c95d <+477>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c962 <+482>:  movq   0x16deec7(%rip), %rax     ; direct field offset for GopChat.CallViewController.webv4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIWebView>
0x101d2c969 <+489>:  movq   -0x10(%rbp), %rsi
0x101d2c96d <+493>:  movq   (%rsi,%rax), %rdi
0x101d2c971 <+497>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c976 <+502>:  movq   0x16deebb(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAvatar1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c97d <+509>:  movq   -0x10(%rbp), %rsi
0x101d2c981 <+513>:  movq   (%rsi,%rax), %rdi
0x101d2c985 <+517>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c98a <+522>:  movq   0x16deeaf(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblName1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c991 <+529>:  movq   -0x10(%rbp), %rsi
0x101d2c995 <+533>:  movq   (%rsi,%rax), %rdi
0x101d2c999 <+537>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c99e <+542>:  movq   0x16deea3(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgLocation1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c9a5 <+549>:  movq   -0x10(%rbp), %rsi
0x101d2c9a9 <+553>:  movq   (%rsi,%rax), %rdi
0x101d2c9ad <+557>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c9b2 <+562>:  movq   0x16dee97(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblCountry1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c9b9 <+569>:  movq   -0x10(%rbp), %rsi
0x101d2c9bd <+573>:  movq   (%rsi,%rax), %rdi
0x101d2c9c1 <+577>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c9c6 <+582>:  movq   0x16dee8b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c9cd <+589>:  movq   -0x10(%rbp), %rsi
0x101d2c9d1 <+593>:  movq   (%rsi,%rax), %rdi
0x101d2c9d5 <+597>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c9da <+602>:  movq   0x16dee7f(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg11 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c9e1 <+609>:  movq   -0x10(%rbp), %rsi
0x101d2c9e5 <+613>:  movq   (%rsi,%rax), %rdi
0x101d2c9e9 <+617>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c9ee <+622>:  movq   0x16dee73(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgReport1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c9f5 <+629>:  movq   -0x10(%rbp), %rsi
0x101d2c9f9 <+633>:  movq   (%rsi,%rax), %rdi
0x101d2c9fd <+637>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca02 <+642>:  movq   0x16dee67(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblReport1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2ca09 <+649>:  movq   -0x10(%rbp), %rsi
0x101d2ca0d <+653>:  movq   (%rsi,%rax), %rdi
0x101d2ca11 <+657>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca16 <+662>:  movq   0x16dee5b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAvatar2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2ca1d <+669>:  movq   -0x10(%rbp), %rsi
0x101d2ca21 <+673>:  movq   (%rsi,%rax), %rdi
0x101d2ca25 <+677>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca2a <+682>:  movq   0x16dee4f(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblName2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2ca31 <+689>:  movq   -0x10(%rbp), %rsi
0x101d2ca35 <+693>:  movq   (%rsi,%rax), %rdi
0x101d2ca39 <+697>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca3e <+702>:  movq   0x16dee43(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgLocation2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2ca45 <+709>:  movq   -0x10(%rbp), %rsi
0x101d2ca49 <+713>:  movq   (%rsi,%rax), %rdi
0x101d2ca4d <+717>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca52 <+722>:  movq   0x16dee37(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblCountry2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2ca59 <+729>:  movq   -0x10(%rbp), %rsi
0x101d2ca5d <+733>:  movq   (%rsi,%rax), %rdi
0x101d2ca61 <+737>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca66 <+742>:  movq   0x16dee2b(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnReport2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2ca6d <+749>:  movq   -0x10(%rbp), %rsi
0x101d2ca71 <+753>:  movq   (%rsi,%rax), %rdi
0x101d2ca75 <+757>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca7a <+762>:  movq   0x16dee1f(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2ca81 <+769>:  movq   -0x10(%rbp), %rsi
0x101d2ca85 <+773>:  movq   (%rsi,%rax), %rdi
0x101d2ca89 <+777>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca8e <+782>:  movq   0x16dee13(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg22 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2ca95 <+789>:  movq   -0x10(%rbp), %rsi
0x101d2ca99 <+793>:  movq   (%rsi,%rax), %rdi
0x101d2ca9d <+797>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2caa2 <+802>:  movq   0x16dee07(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgReport2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2caa9 <+809>:  movq   -0x10(%rbp), %rsi
0x101d2caad <+813>:  movq   (%rsi,%rax), %rdi
0x101d2cab1 <+817>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cab6 <+822>:  movq   0x16dedfb(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblReport2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cabd <+829>:  movq   -0x10(%rbp), %rsi
0x101d2cac1 <+833>:  movq   (%rsi,%rax), %rdi
0x101d2cac5 <+837>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2caca <+842>:  movq   0x16dedef(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAvatar3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cad1 <+849>:  movq   -0x10(%rbp), %rsi
0x101d2cad5 <+853>:  movq   (%rsi,%rax), %rdi
0x101d2cad9 <+857>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cade <+862>:  movq   0x16dede3(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblName3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cae5 <+869>:  movq   -0x10(%rbp), %rsi
0x101d2cae9 <+873>:  movq   (%rsi,%rax), %rdi
0x101d2caed <+877>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2caf2 <+882>:  movq   0x16dedd7(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgLocation3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2caf9 <+889>:  movq   -0x10(%rbp), %rsi
0x101d2cafd <+893>:  movq   (%rsi,%rax), %rdi
0x101d2cb01 <+897>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb06 <+902>:  movq   0x16dedcb(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblCountry3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cb0d <+909>:  movq   -0x10(%rbp), %rsi
0x101d2cb11 <+913>:  movq   (%rsi,%rax), %rdi
0x101d2cb15 <+917>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb1a <+922>:  movq   0x16dedbf(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnReport3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2cb21 <+929>:  movq   -0x10(%rbp), %rsi
0x101d2cb25 <+933>:  movq   (%rsi,%rax), %rdi
0x101d2cb29 <+937>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb2e <+942>:  movq   0x16dedb3(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cb35 <+949>:  movq   -0x10(%rbp), %rsi
0x101d2cb39 <+953>:  movq   (%rsi,%rax), %rdi
0x101d2cb3d <+957>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb42 <+962>:  movq   0x16deda7(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg33 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cb49 <+969>:  movq   -0x10(%rbp), %rsi
0x101d2cb4d <+973>:  movq   (%rsi,%rax), %rdi
0x101d2cb51 <+977>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb56 <+982>:  movq   0x16ded9b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgReport3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cb5d <+989>:  movq   -0x10(%rbp), %rsi
0x101d2cb61 <+993>:  movq   (%rsi,%rax), %rdi
0x101d2cb65 <+997>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb6a <+1002>: movq   0x16ded8f(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblReport3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cb71 <+1009>: movq   -0x10(%rbp), %rsi
0x101d2cb75 <+1013>: movq   (%rsi,%rax), %rdi
0x101d2cb79 <+1017>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb7e <+1022>: movq   0x16ded83(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAvatar4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cb85 <+1029>: movq   -0x10(%rbp), %rsi
0x101d2cb89 <+1033>: movq   (%rsi,%rax), %rdi
0x101d2cb8d <+1037>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb92 <+1042>: movq   0x16ded77(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblName4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cb99 <+1049>: movq   -0x10(%rbp), %rsi
0x101d2cb9d <+1053>: movq   (%rsi,%rax), %rdi
0x101d2cba1 <+1057>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cba6 <+1062>: movq   0x16ded6b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgLocation4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cbad <+1069>: movq   -0x10(%rbp), %rsi
0x101d2cbb1 <+1073>: movq   (%rsi,%rax), %rdi
0x101d2cbb5 <+1077>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cbba <+1082>: movq   0x16ded5f(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblCountry4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cbc1 <+1089>: movq   -0x10(%rbp), %rsi
0x101d2cbc5 <+1093>: movq   (%rsi,%rax), %rdi
0x101d2cbc9 <+1097>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cbce <+1102>: movq   0x16ded53(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnReport4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2cbd5 <+1109>: movq   -0x10(%rbp), %rsi
0x101d2cbd9 <+1113>: movq   (%rsi,%rax), %rdi
0x101d2cbdd <+1117>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cbe2 <+1122>: movq   0x16ded47(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cbe9 <+1129>: movq   -0x10(%rbp), %rsi
0x101d2cbed <+1133>: movq   (%rsi,%rax), %rdi
0x101d2cbf1 <+1137>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cbf6 <+1142>: movq   0x16ded3b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg44 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cbfd <+1149>: movq   -0x10(%rbp), %rsi
0x101d2cc01 <+1153>: movq   (%rsi,%rax), %rdi
0x101d2cc05 <+1157>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc0a <+1162>: movq   0x16ded2f(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgReport4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cc11 <+1169>: movq   -0x10(%rbp), %rsi
0x101d2cc15 <+1173>: movq   (%rsi,%rax), %rdi
0x101d2cc19 <+1177>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc1e <+1182>: movq   0x16ded23(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblReport4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cc25 <+1189>: movq   -0x10(%rbp), %rsi
0x101d2cc29 <+1193>: movq   (%rsi,%rax), %rdi
0x101d2cc2d <+1197>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc32 <+1202>: movq   0x16ded17(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewReport1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc39 <+1209>: movq   -0x10(%rbp), %rsi
0x101d2cc3d <+1213>: movq   (%rsi,%rax), %rdi
0x101d2cc41 <+1217>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc46 <+1222>: movq   0x16ded0b(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar11 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc4d <+1229>: movq   -0x10(%rbp), %rsi
0x101d2cc51 <+1233>: movq   (%rsi,%rax), %rdi
0x101d2cc55 <+1237>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc5a <+1242>: movq   0x16decff(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar12 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc61 <+1249>: movq   -0x10(%rbp), %rsi
0x101d2cc65 <+1253>: movq   (%rsi,%rax), %rdi
0x101d2cc69 <+1257>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc6e <+1262>: movq   0x16decf3(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar13 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc75 <+1269>: movq   -0x10(%rbp), %rsi
0x101d2cc79 <+1273>: movq   (%rsi,%rax), %rdi
0x101d2cc7d <+1277>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc82 <+1282>: movq   0x16dece7(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewReport2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc89 <+1289>: movq   -0x10(%rbp), %rsi
0x101d2cc8d <+1293>: movq   (%rsi,%rax), %rdi
0x101d2cc91 <+1297>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc96 <+1302>: movq   0x16decdb(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar21 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc9d <+1309>: movq   -0x10(%rbp), %rsi
0x101d2cca1 <+1313>: movq   (%rsi,%rax), %rdi
0x101d2cca5 <+1317>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ccaa <+1322>: movq   0x16deccf(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar22 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2ccb1 <+1329>: movq   -0x10(%rbp), %rsi
0x101d2ccb5 <+1333>: movq   (%rsi,%rax), %rdi
0x101d2ccb9 <+1337>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ccbe <+1342>: movq   0x16decc3(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar23 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2ccc5 <+1349>: movq   -0x10(%rbp), %rsi
0x101d2ccc9 <+1353>: movq   (%rsi,%rax), %rdi
0x101d2cccd <+1357>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ccd2 <+1362>: movq   0x16decb7(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewReport3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2ccd9 <+1369>: movq   -0x10(%rbp), %rsi
0x101d2ccdd <+1373>: movq   (%rsi,%rax), %rdi
0x101d2cce1 <+1377>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cce6 <+1382>: movq   0x16decab(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar31 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cced <+1389>: movq   -0x10(%rbp), %rsi
0x101d2ccf1 <+1393>: movq   (%rsi,%rax), %rdi
0x101d2ccf5 <+1397>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ccfa <+1402>: movq   0x16dec9f(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar32 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cd01 <+1409>: movq   -0x10(%rbp), %rsi
0x101d2cd05 <+1413>: movq   (%rsi,%rax), %rdi
0x101d2cd09 <+1417>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cd0e <+1422>: movq   0x16dec93(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar33 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cd15 <+1429>: movq   -0x10(%rbp), %rsi
0x101d2cd19 <+1433>: movq   (%rsi,%rax), %rdi
0x101d2cd1d <+1437>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cd22 <+1442>: movq   0x16dec87(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewReport4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cd29 <+1449>: movq   -0x10(%rbp), %rsi
0x101d2cd2d <+1453>: movq   (%rsi,%rax), %rdi
0x101d2cd31 <+1457>: callq  0x102b63130               ; symbol stub
```

<p>I have tried <strong>NSZombie</strong> but could not find anything. I shall be thankful for help.</p>

<p>When I comment the following lines in viewDidLoad() there is no crash</p>

```localAudioTrack = peerConnectionFactory.audioTrack(withTrackId: uuid!)
mediaStream = peerConnectionFactory.mediaStream(withStreamId: LOCAL_MEDIA_STREAM_ID)
mediaStream.addAudioTrack(localAudioTrack)
```

<p>Here is the declaration of these variables</p>

```private var mediaStream: RTCMediaStream!
private var localAudioTrack: RTCAudioTrack!
private var dataChannel: RTCDataChannel!
```

答: Try making the mediaStream and localAudioTrack variables weak. This will create weak pointers to them and if no objects are referring to them any more they get released from the stack. Also weak will make them possible to become nil once released. </p>

Body:
I am using webRTC framework for audio call in my application. After dismissing call view controller I am getting the following error on App delegate.

Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)

Following is the screenshot of xcode

Following is the stack trace

CallViewController.__ivar_destroyer:
0x101d2c780 <+0>:    pushq  %rbp
0x101d2c781 <+1>:    movq   %rsp, %rbp
0x101d2c784 <+4>:    subq   $0x20, %rsp
0x101d2c788 <+8>:    movq   %rdi, %rax
0x101d2c78b <+11>:   movq   %rax, -0x8(%rbp)
0x101d2c78f <+15>:   movq   0x16dfb02(%rip), %rax     ; direct field offset for GopChat.CallViewController.(ws in _024208FCD932FF59905765BE8E3FA1C3) : SwiftWebSocket.WebSocket
0x101d2c796 <+22>:   movq   (%rdi,%rax), %rax
0x101d2c79a <+26>:   movq   %rdi, -0x10(%rbp)
0x101d2c79e <+30>:   movq   %rax, %rdi
0x101d2c7a1 <+33>:   movq   %rsi, -0x18(%rbp)
0x101d2c7a5 <+37>:   callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7aa <+42>:   movq   0x16defcf(%rip), %rax     ; direct field offset for GopChat.CallViewController.reachability : __ObjC.Reachability
0x101d2c7b1 <+49>:   movq   -0x10(%rbp), %rsi
0x101d2c7b5 <+53>:   movq   (%rsi,%rax), %rdi
0x101d2c7b9 <+57>:   callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7be <+62>:   movq   0x16defc3(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnBack : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c7c5 <+69>:   movq   -0x10(%rbp), %rsi
0x101d2c7c9 <+73>:   movq   (%rsi,%rax), %rdi
0x101d2c7cd <+77>:   callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7d2 <+82>:   movq   0x16defb7(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblTopicWait : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c7d9 <+89>:   movq   -0x10(%rbp), %rsi
0x101d2c7dd <+93>:   movq   (%rsi,%rax), %rdi
0x101d2c7e1 <+97>:   callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7e6 <+102>:  movq   0x16defab(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblMessageWait : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c7ed <+109>:  movq   -0x10(%rbp), %rsi
0x101d2c7f1 <+113>:  movq   (%rsi,%rax), %rdi
0x101d2c7f5 <+117>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c7fa <+122>:  movq   0x16def9f(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgWait : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c801 <+129>:  movq   -0x10(%rbp), %rsi
0x101d2c805 <+133>:  movq   (%rsi,%rax), %rdi
0x101d2c809 <+137>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c80e <+142>:  movq   0x16def93(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewWaiting : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c815 <+149>:  movq   -0x10(%rbp), %rsi
0x101d2c819 <+153>:  movq   (%rsi,%rax), %rdi
0x101d2c81d <+157>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c822 <+162>:  movq   0x16def87(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewBeforeCall : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c829 <+169>:  movq   -0x10(%rbp), %rsi
0x101d2c82d <+173>:  movq   (%rsi,%rax), %rdi
0x101d2c831 <+177>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c836 <+182>:  movq   0x16def7b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAlpha : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c83d <+189>:  movq   -0x10(%rbp), %rsi
0x101d2c841 <+193>:  movq   (%rsi,%rax), %rdi
0x101d2c845 <+197>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c84a <+202>:  movq   0x16def6f(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblTopic : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c851 <+209>:  movq   -0x10(%rbp), %rsi
0x101d2c855 <+213>:  movq   (%rsi,%rax), %rdi
0x101d2c859 <+217>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c85e <+222>:  movq   0x16def63(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblTime : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c865 <+229>:  movq   -0x10(%rbp), %rsi
0x101d2c869 <+233>:  movq   (%rsi,%rax), %rdi
0x101d2c86d <+237>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c872 <+242>:  movq   0x16def57(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnHangup : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c879 <+249>:  movq   -0x10(%rbp), %rsi
0x101d2c87d <+253>:  movq   (%rsi,%rax), %rdi
0x101d2c881 <+257>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c886 <+262>:  movq   0x16def4b(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnMicrophone : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c88d <+269>:  movq   -0x10(%rbp), %rsi
0x101d2c891 <+273>:  movq   (%rsi,%rax), %rdi
0x101d2c895 <+277>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c89a <+282>:  movq   0x16def3f(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnSpeaker : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c8a1 <+289>:  movq   -0x10(%rbp), %rsi
0x101d2c8a5 <+293>:  movq   (%rsi,%rax), %rdi
0x101d2c8a9 <+297>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8ae <+302>:  movq   0x16def33(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnNext : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2c8b5 <+309>:  movq   -0x10(%rbp), %rsi
0x101d2c8b9 <+313>:  movq   (%rsi,%rax), %rdi
0x101d2c8bd <+317>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8c2 <+322>:  movq   0x16def27(%rip), %rax     ; direct field offset for GopChat.CallViewController.stackViewCalls : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIStackView>
0x101d2c8c9 <+329>:  movq   -0x10(%rbp), %rsi
0x101d2c8cd <+333>:  movq   (%rsi,%rax), %rdi
0x101d2c8d1 <+337>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8d6 <+342>:  movq   0x16def1b(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewCall1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c8dd <+349>:  movq   -0x10(%rbp), %rsi
0x101d2c8e1 <+353>:  movq   (%rsi,%rax), %rdi
0x101d2c8e5 <+357>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8ea <+362>:  movq   0x16def0f(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewCall2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c8f1 <+369>:  movq   -0x10(%rbp), %rsi
0x101d2c8f5 <+373>:  movq   (%rsi,%rax), %rdi
0x101d2c8f9 <+377>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c8fe <+382>:  movq   0x16def03(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewCall3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c905 <+389>:  movq   -0x10(%rbp), %rsi
0x101d2c909 <+393>:  movq   (%rsi,%rax), %rdi
0x101d2c90d <+397>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c912 <+402>:  movq   0x16deef7(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewCall4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2c919 <+409>:  movq   -0x10(%rbp), %rsi
0x101d2c91d <+413>:  movq   (%rsi,%rax), %rdi
0x101d2c921 <+417>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c926 <+422>:  movq   0x16deeeb(%rip), %rax     ; direct field offset for GopChat.CallViewController.webv1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIWebView>
0x101d2c92d <+429>:  movq   -0x10(%rbp), %rsi
0x101d2c931 <+433>:  movq   (%rsi,%rax), %rdi
0x101d2c935 <+437>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c93a <+442>:  movq   0x16deedf(%rip), %rax     ; direct field offset for GopChat.CallViewController.webv2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIWebView>
0x101d2c941 <+449>:  movq   -0x10(%rbp), %rsi
0x101d2c945 <+453>:  movq   (%rsi,%rax), %rdi
0x101d2c949 <+457>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c94e <+462>:  movq   0x16deed3(%rip), %rax     ; direct field offset for GopChat.CallViewController.webv3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIWebView>
0x101d2c955 <+469>:  movq   -0x10(%rbp), %rsi
0x101d2c959 <+473>:  movq   (%rsi,%rax), %rdi
0x101d2c95d <+477>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c962 <+482>:  movq   0x16deec7(%rip), %rax     ; direct field offset for GopChat.CallViewController.webv4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIWebView>
0x101d2c969 <+489>:  movq   -0x10(%rbp), %rsi
0x101d2c96d <+493>:  movq   (%rsi,%rax), %rdi
0x101d2c971 <+497>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c976 <+502>:  movq   0x16deebb(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAvatar1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c97d <+509>:  movq   -0x10(%rbp), %rsi
0x101d2c981 <+513>:  movq   (%rsi,%rax), %rdi
0x101d2c985 <+517>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c98a <+522>:  movq   0x16deeaf(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblName1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c991 <+529>:  movq   -0x10(%rbp), %rsi
0x101d2c995 <+533>:  movq   (%rsi,%rax), %rdi
0x101d2c999 <+537>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c99e <+542>:  movq   0x16deea3(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgLocation1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c9a5 <+549>:  movq   -0x10(%rbp), %rsi
0x101d2c9a9 <+553>:  movq   (%rsi,%rax), %rdi
0x101d2c9ad <+557>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c9b2 <+562>:  movq   0x16dee97(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblCountry1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2c9b9 <+569>:  movq   -0x10(%rbp), %rsi
0x101d2c9bd <+573>:  movq   (%rsi,%rax), %rdi
0x101d2c9c1 <+577>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c9c6 <+582>:  movq   0x16dee8b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c9cd <+589>:  movq   -0x10(%rbp), %rsi
0x101d2c9d1 <+593>:  movq   (%rsi,%rax), %rdi
0x101d2c9d5 <+597>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c9da <+602>:  movq   0x16dee7f(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg11 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c9e1 <+609>:  movq   -0x10(%rbp), %rsi
0x101d2c9e5 <+613>:  movq   (%rsi,%rax), %rdi
0x101d2c9e9 <+617>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2c9ee <+622>:  movq   0x16dee73(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgReport1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2c9f5 <+629>:  movq   -0x10(%rbp), %rsi
0x101d2c9f9 <+633>:  movq   (%rsi,%rax), %rdi
0x101d2c9fd <+637>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca02 <+642>:  movq   0x16dee67(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblReport1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2ca09 <+649>:  movq   -0x10(%rbp), %rsi
0x101d2ca0d <+653>:  movq   (%rsi,%rax), %rdi
0x101d2ca11 <+657>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca16 <+662>:  movq   0x16dee5b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAvatar2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2ca1d <+669>:  movq   -0x10(%rbp), %rsi
0x101d2ca21 <+673>:  movq   (%rsi,%rax), %rdi
0x101d2ca25 <+677>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca2a <+682>:  movq   0x16dee4f(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblName2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2ca31 <+689>:  movq   -0x10(%rbp), %rsi
0x101d2ca35 <+693>:  movq   (%rsi,%rax), %rdi
0x101d2ca39 <+697>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca3e <+702>:  movq   0x16dee43(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgLocation2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2ca45 <+709>:  movq   -0x10(%rbp), %rsi
0x101d2ca49 <+713>:  movq   (%rsi,%rax), %rdi
0x101d2ca4d <+717>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca52 <+722>:  movq   0x16dee37(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblCountry2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2ca59 <+729>:  movq   -0x10(%rbp), %rsi
0x101d2ca5d <+733>:  movq   (%rsi,%rax), %rdi
0x101d2ca61 <+737>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca66 <+742>:  movq   0x16dee2b(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnReport2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2ca6d <+749>:  movq   -0x10(%rbp), %rsi
0x101d2ca71 <+753>:  movq   (%rsi,%rax), %rdi
0x101d2ca75 <+757>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca7a <+762>:  movq   0x16dee1f(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2ca81 <+769>:  movq   -0x10(%rbp), %rsi
0x101d2ca85 <+773>:  movq   (%rsi,%rax), %rdi
0x101d2ca89 <+777>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ca8e <+782>:  movq   0x16dee13(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg22 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2ca95 <+789>:  movq   -0x10(%rbp), %rsi
0x101d2ca99 <+793>:  movq   (%rsi,%rax), %rdi
0x101d2ca9d <+797>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2caa2 <+802>:  movq   0x16dee07(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgReport2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2caa9 <+809>:  movq   -0x10(%rbp), %rsi
0x101d2caad <+813>:  movq   (%rsi,%rax), %rdi
0x101d2cab1 <+817>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cab6 <+822>:  movq   0x16dedfb(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblReport2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cabd <+829>:  movq   -0x10(%rbp), %rsi
0x101d2cac1 <+833>:  movq   (%rsi,%rax), %rdi
0x101d2cac5 <+837>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2caca <+842>:  movq   0x16dedef(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAvatar3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cad1 <+849>:  movq   -0x10(%rbp), %rsi
0x101d2cad5 <+853>:  movq   (%rsi,%rax), %rdi
0x101d2cad9 <+857>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cade <+862>:  movq   0x16dede3(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblName3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cae5 <+869>:  movq   -0x10(%rbp), %rsi
0x101d2cae9 <+873>:  movq   (%rsi,%rax), %rdi
0x101d2caed <+877>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2caf2 <+882>:  movq   0x16dedd7(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgLocation3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2caf9 <+889>:  movq   -0x10(%rbp), %rsi
0x101d2cafd <+893>:  movq   (%rsi,%rax), %rdi
0x101d2cb01 <+897>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb06 <+902>:  movq   0x16dedcb(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblCountry3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cb0d <+909>:  movq   -0x10(%rbp), %rsi
0x101d2cb11 <+913>:  movq   (%rsi,%rax), %rdi
0x101d2cb15 <+917>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb1a <+922>:  movq   0x16dedbf(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnReport3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2cb21 <+929>:  movq   -0x10(%rbp), %rsi
0x101d2cb25 <+933>:  movq   (%rsi,%rax), %rdi
0x101d2cb29 <+937>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb2e <+942>:  movq   0x16dedb3(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cb35 <+949>:  movq   -0x10(%rbp), %rsi
0x101d2cb39 <+953>:  movq   (%rsi,%rax), %rdi
0x101d2cb3d <+957>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb42 <+962>:  movq   0x16deda7(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg33 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cb49 <+969>:  movq   -0x10(%rbp), %rsi
0x101d2cb4d <+973>:  movq   (%rsi,%rax), %rdi
0x101d2cb51 <+977>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb56 <+982>:  movq   0x16ded9b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgReport3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cb5d <+989>:  movq   -0x10(%rbp), %rsi
0x101d2cb61 <+993>:  movq   (%rsi,%rax), %rdi
0x101d2cb65 <+997>:  callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb6a <+1002>: movq   0x16ded8f(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblReport3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cb71 <+1009>: movq   -0x10(%rbp), %rsi
0x101d2cb75 <+1013>: movq   (%rsi,%rax), %rdi
0x101d2cb79 <+1017>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb7e <+1022>: movq   0x16ded83(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgAvatar4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cb85 <+1029>: movq   -0x10(%rbp), %rsi
0x101d2cb89 <+1033>: movq   (%rsi,%rax), %rdi
0x101d2cb8d <+1037>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cb92 <+1042>: movq   0x16ded77(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblName4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cb99 <+1049>: movq   -0x10(%rbp), %rsi
0x101d2cb9d <+1053>: movq   (%rsi,%rax), %rdi
0x101d2cba1 <+1057>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cba6 <+1062>: movq   0x16ded6b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgLocation4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cbad <+1069>: movq   -0x10(%rbp), %rsi
0x101d2cbb1 <+1073>: movq   (%rsi,%rax), %rdi
0x101d2cbb5 <+1077>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cbba <+1082>: movq   0x16ded5f(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblCountry4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cbc1 <+1089>: movq   -0x10(%rbp), %rsi
0x101d2cbc5 <+1093>: movq   (%rsi,%rax), %rdi
0x101d2cbc9 <+1097>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cbce <+1102>: movq   0x16ded53(%rip), %rax     ; direct field offset for GopChat.CallViewController.btnReport4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIButton>
0x101d2cbd5 <+1109>: movq   -0x10(%rbp), %rsi
0x101d2cbd9 <+1113>: movq   (%rsi,%rax), %rdi
0x101d2cbdd <+1117>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cbe2 <+1122>: movq   0x16ded47(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cbe9 <+1129>: movq   -0x10(%rbp), %rsi
0x101d2cbed <+1133>: movq   (%rsi,%rax), %rdi
0x101d2cbf1 <+1137>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cbf6 <+1142>: movq   0x16ded3b(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgBg44 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cbfd <+1149>: movq   -0x10(%rbp), %rsi
0x101d2cc01 <+1153>: movq   (%rsi,%rax), %rdi
0x101d2cc05 <+1157>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc0a <+1162>: movq   0x16ded2f(%rip), %rax     ; direct field offset for GopChat.CallViewController.imgReport4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIImageView>
0x101d2cc11 <+1169>: movq   -0x10(%rbp), %rsi
0x101d2cc15 <+1173>: movq   (%rsi,%rax), %rdi
0x101d2cc19 <+1177>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc1e <+1182>: movq   0x16ded23(%rip), %rax     ; direct field offset for GopChat.CallViewController.lblReport4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UILabel>
0x101d2cc25 <+1189>: movq   -0x10(%rbp), %rsi
0x101d2cc29 <+1193>: movq   (%rsi,%rax), %rdi
0x101d2cc2d <+1197>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc32 <+1202>: movq   0x16ded17(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewReport1 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc39 <+1209>: movq   -0x10(%rbp), %rsi
0x101d2cc3d <+1213>: movq   (%rsi,%rax), %rdi
0x101d2cc41 <+1217>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc46 <+1222>: movq   0x16ded0b(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar11 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc4d <+1229>: movq   -0x10(%rbp), %rsi
0x101d2cc51 <+1233>: movq   (%rsi,%rax), %rdi
0x101d2cc55 <+1237>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc5a <+1242>: movq   0x16decff(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar12 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc61 <+1249>: movq   -0x10(%rbp), %rsi
0x101d2cc65 <+1253>: movq   (%rsi,%rax), %rdi
0x101d2cc69 <+1257>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc6e <+1262>: movq   0x16decf3(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar13 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc75 <+1269>: movq   -0x10(%rbp), %rsi
0x101d2cc79 <+1273>: movq   (%rsi,%rax), %rdi
0x101d2cc7d <+1277>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc82 <+1282>: movq   0x16dece7(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewReport2 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc89 <+1289>: movq   -0x10(%rbp), %rsi
0x101d2cc8d <+1293>: movq   (%rsi,%rax), %rdi
0x101d2cc91 <+1297>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cc96 <+1302>: movq   0x16decdb(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar21 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cc9d <+1309>: movq   -0x10(%rbp), %rsi
0x101d2cca1 <+1313>: movq   (%rsi,%rax), %rdi
0x101d2cca5 <+1317>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ccaa <+1322>: movq   0x16deccf(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar22 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2ccb1 <+1329>: movq   -0x10(%rbp), %rsi
0x101d2ccb5 <+1333>: movq   (%rsi,%rax), %rdi
0x101d2ccb9 <+1337>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ccbe <+1342>: movq   0x16decc3(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar23 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2ccc5 <+1349>: movq   -0x10(%rbp), %rsi
0x101d2ccc9 <+1353>: movq   (%rsi,%rax), %rdi
0x101d2cccd <+1357>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ccd2 <+1362>: movq   0x16decb7(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewReport3 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2ccd9 <+1369>: movq   -0x10(%rbp), %rsi
0x101d2ccdd <+1373>: movq   (%rsi,%rax), %rdi
0x101d2cce1 <+1377>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cce6 <+1382>: movq   0x16decab(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar31 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cced <+1389>: movq   -0x10(%rbp), %rsi
0x101d2ccf1 <+1393>: movq   (%rsi,%rax), %rdi
0x101d2ccf5 <+1397>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2ccfa <+1402>: movq   0x16dec9f(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar32 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cd01 <+1409>: movq   -0x10(%rbp), %rsi
0x101d2cd05 <+1413>: movq   (%rsi,%rax), %rdi
0x101d2cd09 <+1417>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cd0e <+1422>: movq   0x16dec93(%rip), %rax     ; direct field offset for GopChat.CallViewController.reportBar33 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cd15 <+1429>: movq   -0x10(%rbp), %rsi
0x101d2cd19 <+1433>: movq   (%rsi,%rax), %rdi
0x101d2cd1d <+1437>: callq  0x102b63130               ; symbol stub for: objc_release
0x101d2cd22 <+1442>: movq   0x16dec87(%rip), %rax     ; direct field offset for GopChat.CallViewController.viewReport4 : Swift.ImplicitlyUnwrappedOptional<__ObjC.UIView>
0x101d2cd29 <+1449>: movq   -0x10(%rbp), %rsi
0x101d2cd2d <+1453>: movq   (%rsi,%rax), %rdi
0x101d2cd31 <+1457>: callq  0x102b63130               ; symbol stub

I have tried NSZombie but could not find anything. I shall be thankful for help.

When I comment the following lines in viewDidLoad() there is no crash

localAudioTrack = peerConnectionFactory.audioTrack(withTrackId: uuid!)
mediaStream = peerConnectionFactory.mediaStream(withStreamId: LOCAL_MEDIA_STREAM_ID)
mediaStream.addAudioTrack(localAudioTrack)

Here is the declaration of these variables

private var mediaStream: RTCMediaStream!
private var localAudioTrack: RTCAudioTrack!
private var dataChannel: RTCDataChannel!


来源: stackexchange

问:
Declare array of lambdas in Java
I'd like to create an array of lambda. The problem is that the lambda could be different from each other. Example:

```<code>private interface I0 {
    int interface0(int a, int b);
}

private interface I1 {
    int interface1(double d);
}
</code>```

Now, how can I declare a list which can contain both I0 and I1?

```<code>List<Object> test = Arrays.asList(
        (int a, int b) -> a + b,
        (double d) -> d * 2
);
</code>```

Obviously Object does not work.

答:
You could cast to the respective Interface like:

```<code>List<Object> test = Arrays.asList(
    (I0) (int a, int b) -> a + b,
    (I1) (double d) -> (int) (d * 2)
);
</code>```

despite this being shorter, I would also consider Eran's answer maybe it is more readable and easier to understand (if having more functions). And I also can't see the use case for such a construct...

It gets even shorter (not necessarily better):

```<code>List<Object> test = Arrays.asList(
    (I0) (a, b) -> a + b,
    (I1) d -> (int) (d * 2)
);
</code>```

ContentLicense: CC BY-SA 3.0

Title: Declare array of lambdas in Java

Body:
I'd like to create an array of lambda. The problem is that the lambda could be different from each other. Example:

private interface I0 {
    int interface0(int a, int b);
}

private interface I1 {
    int interface1(double d);
}

Now, how can I declare a list which can contain both I0 and I1?

List<Object> test = Arrays.asList(
        (int a, int b) -> a + b,
        (double d) -> d * 2
);

Obviously Object does not work.

Body:
You could cast to the respective Interface like:

List<Object> test = Arrays.asList(
    (I0) (int a, int b) -> a + b,
    (I1) (double d) -> (int) (d * 2)
);

despite this being shorter, I would also consider Eran's answer maybe it is more readable and easier to understand (if having more functions). And I also can't see the use case for such a construct...

It gets even shorter (not necessarily better):

List<Object> test = Arrays.asList(
    (I0) (a, b) -> a + b,
    (I1) d -> (int) (d * 2)
);


问:
How to exit if statement and continue to else
This is a long shot question, but is there a way in php to exit an "if" statement and continue on to the "else" statement if an error occurs inside the if block?

example

```<code>if ($condition == "good")
{
//do method one

//error occurs during method one, need to exit and continue to else

}

else
{
//do method two
}
</code>```

Of course it is possible to do a nested if inside the first if, but that seems hacky.

TIA

答:
```<code>if ($condition == "good") {
    try{
        method_1();
    }
    catch(Exception $e){
       method_2();
    }
}
else {
    method_2();
}

function method_2(){
   //some statement
}
</code>```

Body:
This is a long shot question, but is there a way in php to exit an "if" statement and continue on to the "else" statement if an error occurs inside the if block?

example

if ($condition == "good")
{
//do method one

//error occurs during method one, need to exit and continue to else

}

else
{
//do method two
}

Of course it is possible to do a nested if inside the first if, but that seems hacky.

TIA


问:
Hibernate : collection cache not evicted
I'm experiencing an issue with Hibernate collections caching (by EHCache).

So, this is the entity that owns the collection :

```<code>@Entity(name = "Message")
@Table(name = "t_message")
public class Message implements Comparable<Message>{
    @Id
    @Column(name = "message_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "message")
    @Sort(type = SortType.NATURAL)
    @JsonIgnore
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
    private SortedSet<Event> events = new TreeSet<>();

    // ...
}
</code>```

Then, in the other entity, there is a symetrical to the Message :

```<code>@Entity(name = "Event")
@Table(name = "t_event")
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
public class Event implements Comparable<Event>, Comparator<Event> {
    @Id
    @Column(name = "event_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "event_message_id", referencedColumnName = "message_id")
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
    private Message message;

    // ...
}
</code>```

The problem : when I add an Event, the "events" field, the cache is not evicted. If I remove the @Cache anotation below this field, it works but of course with no cache.

I believed this has to be linked with the fact that when inserting a new event (by entity manipulations), we link it to a message from the event side so I added this line on hibernate configuration file :

```<code><property name="hibernate.cache.auto_evict_collection_cache">true</property>
</code>```

But it didn't solve the problem.

Additional informations :

Other ManyToOne collections caching works perfectly on the project.

There is no native queries in the project, only HQL and entities manipulations.

I'm using Hibernate 4.3.2 and EHCache 2.10.4.

Thanks for your advices.

答:
Ok, just figured out that a "cascade" parameter was missing in the Message's events field @OneToMany annotation :

```<code>@ManyToOne(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
@JoinColumn(name = "event_message_id", referencedColumnName = "message_id")
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
private Message message;
</code>```

Solved !

Body:
I'm experiencing an issue with Hibernate collections caching (by EHCache).

So, this is the entity that owns the collection :

@Entity(name = "Message")
@Table(name = "t_message")
public class Message implements Comparable<Message>{
    @Id
    @Column(name = "message_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "message")
    @Sort(type = SortType.NATURAL)
    @JsonIgnore
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
    private SortedSet<Event> events = new TreeSet<>();

    // ...
}

Then, in the other entity, there is a symetrical to the Message :

@Entity(name = "Event")
@Table(name = "t_event")
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
public class Event implements Comparable<Event>, Comparator<Event> {
    @Id
    @Column(name = "event_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "event_message_id", referencedColumnName = "message_id")
    @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
    private Message message;

    // ...
}

The problem : when I add an Event, the "events" field, the cache is not evicted. If I remove the @Cache anotation below this field, it works but of course with no cache.

I believed this has to be linked with the fact that when inserting a new event (by entity manipulations), we link it to a message from the event side so I added this line on hibernate configuration file :

<property name="hibernate.cache.auto_evict_collection_cache">true</property>

But it didn't solve the problem.

Additional informations :

Other ManyToOne collections caching works perfectly on the project.

There is no native queries in the project, only HQL and entities manipulations.

I'm using Hibernate 4.3.2 and EHCache 2.10.4.

Thanks for your advices.

Body:
Ok, just figured out that a "cascade" parameter was missing in the Message's events field @OneToMany annotation :

@ManyToOne(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
@JoinColumn(name = "event_message_id", referencedColumnName = "message_id")
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
private Message message;

Solved !


问:
Android: refreshing list view from different activity
I have ListActivity with CustomArrayAdapter. My extension of ArrayAdapter allows me to do add/remove operations with the rows. It works fine...inside ListActivity. But then I need to add/edit rows in my list from different Activity and troubles begin. How can I do that? All I need inside my EditActivity is CustomArrayAdapter object. I made it static and tried. It worked, but is it a right thing?
Thanks for the answers, masters!</p>

答:
What comes in my mind:

One way could be to make your objects in the ArrayList serializable you could pass then  the actual list to the next activity via intent and use it there for the adapter.

Other way would be: if you know the ID of the element which you want to delete, pass it as intent, delete it from the ArrayList and set adapter.notifyDataSetChanged();

I don't think to have a static ArrayAdapter class is the right way. This means you affect both activities at the same time. Because none of them have an own object.

Hope this helps

ContentLicense: CC BY-SA 2.5


问:
How to clear AlamofireImage setImageWithURL cache
I am using AlamofireImage in my project quite a lot and I use

```<code>let URL = NSURL(string: "https://cdn.domain.com/profile/image.jpg")!
imageView.af_setImageWithURL(URL)
</code>```

to fetch an image from my CDN. I have done some tests but correct me if I am wrong, this seems to store the downloaded image in to a cache. My tests included downloading a 5mb image. The first time it took about 20 seconds, the second time was instant.

The thing I would like to know is how can I clear the cache for a specific URL/image and re-download the image?

Say for example I update a users profile pic. The image name/URL will be exactly the same but I know the image has changes as the user selected a new image from their library or camera. I know the image has been uploaded successfully to the CDN as I can see the new image in the folder directly on the CDN.

答:
Hope this might help you:</p>

```<code>let URL = NSURL(string: "https://cdn.domain.com/profile/image.jpg")!
let imageDownloader = UIImageView.af_sharedImageDownloader
let imageCache = imageDownloader.imageCache
// Setting CachePolicy as reloadIgnoringLocalCacheData so that it won't use URL Cache next time when it is hitting same URL
let urlRequest = URLRequest(url: URL, cachePolicy: URLRequest.CachePolicy.reloadIgnoringLocalCacheData)
        // Clear the Image from the in-memory cache
        let _ = imageCache?.removeImage(for: urlRequest, withIdentifier: nil)
        imageView.af_setImage(withURLRequest: urlRequest, placeholderImage: UIImage(named: "placeholder"), completion: { (response) in
            self.imageView.image = response.result.value
        })
</code>```

Body:
I am using AlamofireImage in my project quite a lot and I use

let URL = NSURL(string: "https://cdn.domain.com/profile/image.jpg")!
imageView.af_setImageWithURL(URL)

to fetch an image from my CDN. I have done some tests but correct me if I am wrong, this seems to store the downloaded image in to a cache. My tests included downloading a 5mb image. The first time it took about 20 seconds, the second time was instant.

The thing I would like to know is how can I clear the cache for a specific URL/image and re-download the image?

Say for example I update a users profile pic. The image name/URL will be exactly the same but I know the image has changes as the user selected a new image from their library or camera. I know the image has been uploaded successfully to the CDN as I can see the new image in the folder directly on the CDN.

Body:
Hope this might help you:

let URL = NSURL(string: "https://cdn.domain.com/profile/image.jpg")!
let imageDownloader = UIImageView.af_sharedImageDownloader
let imageCache = imageDownloader.imageCache
// Setting CachePolicy as reloadIgnoringLocalCacheData so that it won't use URL Cache next time when it is hitting same URL
let urlRequest = URLRequest(url: URL, cachePolicy: URLRequest.CachePolicy.reloadIgnoringLocalCacheData)
        // Clear the Image from the in-memory cache
        let _ = imageCache?.removeImage(for: urlRequest, withIdentifier: nil)
        imageView.af_setImage(withURLRequest: urlRequest, placeholderImage: UIImage(named: "placeholder"), completion: { (response) in
            self.imageView.image = response.result.value
        })


问:
How to pause the animation on mouse hover on image
Please I need help to stop the animation on mouse hover and to continue on mouse out. Please see the url below to view the code. thanks

http://jsfiddle.net/AbdiasSoftware/F8x4p/

```<code>        $(window).load(function(){
        var pos = $('#center').position(),
        radiusSat = $('#sat1').width() * 0.5,
        radius = $('#center').width() * 0.5,
        cx = pos.left + radius,
        cy = pos.top + radius,
        x, y, angle = 0,
        angles = [],
        spc = 360 / 25,
        deg2rad = Math.PI / 180,
        i = 0;

    for(;i < 25; i++) {
        angles.push(angle);
        angle += spc;
    }

    /// space out radius
    radius += (radiusSat + 25);

    loop();

    function loop() {
    for(var i = 0; i < angles.length; i++) {

        angle = angles[i];

        x = cx + radius * Math.cos(angle * deg2rad);
        y = cy + radius * Math.sin(angle * deg2rad);

        $('#sat' + i).css({left:x - radiusSat, top:y - radiusSat});

    angles[i] += 0.1;
        if (angles[i] > 360) angles[i] = 0;
    }

    requestAnimationFrame(loop);

}
});
</code>```

答:
try this-

var pos = $('#center').position(),
    radiusSat = $('#sat1').width() * 0.5,
    radius = $('#center').width() * 0.5,
    cx = pos.left + radius,
    cy = pos.top + radius,
    x, y, angle = 0, angles = [],
    spc = 360 / 5,
    deg2rad = Math.PI / 180,
    i = 0;

for(;i < 5; i++) {
    angles.push(angle);
    angle += spc;
}
stop();
/// space out radius
radius += (radiusSat + 10);
$("#center").mouseover(function(){
   start();
});
$("#center").mouseout(function(){
   stop();
});

var requestId;

function loop(time) {
    requestId = undefined;

   for(var i = 0; i < angles.length; i++) {

        angle = angles[i];

        x = cx + radius * Math.cos(angle * deg2rad);
        y = cy + radius * Math.sin(angle * deg2rad);

        $('#sat' + i).css({left:x - radiusSat, top:y - radiusSat});

        angles[i] = angles[i] + 1;
        if (angles[i] > 360) angles[i] = 0;
    }

    //requestAnimationFrame(loop);

    stop();
}

function stop() {
    if (!requestId) {
       requestId = window.requestAnimationFrame(loop);
    }
}

function start() {
    if (requestId) {
       window.cancelAnimationFrame(requestId);
       requestId = undefined;
    }
}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>div {
    border-radius:50%;
    border:2px solid #000;
    position:fixed;
}
#center {
    width:200px;
    height:200px;
    left:100px;
    top:100px;

}
#sat0, #sat1, #sat2, #sat3, #sat4 {
    width:50px;
    height:50px;

}</code>```

```

Body:
Please I need help to stop the animation on mouse hover and to continue on mouse out. Please see the url below to view the code. thanks

http://jsfiddle.net/AbdiasSoftware/F8x4p/

        $(window).load(function(){
        var pos = $('#center').position(),
        radiusSat = $('#sat1').width() * 0.5,
        radius = $('#center').width() * 0.5,
        cx = pos.left + radius,
        cy = pos.top + radius,
        x, y, angle = 0,
        angles = [],
        spc = 360 / 25,
        deg2rad = Math.PI / 180,
        i = 0;

    for(;i < 25; i++) {
        angles.push(angle);
        angle += spc;
    }

    /// space out radius
    radius += (radiusSat + 25);

    loop();

    function loop() {
    for(var i = 0; i < angles.length; i++) {

        angle = angles[i];

        x = cx + radius * Math.cos(angle * deg2rad);
        y = cy + radius * Math.sin(angle * deg2rad);

        $('#sat' + i).css({left:x - radiusSat, top:y - radiusSat});

    angles[i] += 0.1;
        if (angles[i] > 360) angles[i] = 0;
    }

    requestAnimationFrame(loop);

}
});

Body:
try this-

var pos = $('#center').position(),
    radiusSat = $('#sat1').width() * 0.5,
    radius = $('#center').width() * 0.5,
    cx = pos.left + radius,
    cy = pos.top + radius,
    x, y, angle = 0, angles = [],
    spc = 360 / 5,
    deg2rad = Math.PI / 180,
    i = 0;

for(;i < 5; i++) {
    angles.push(angle);
    angle += spc;
}
stop();
/// space out radius
radius += (radiusSat + 10);
$("#center").mouseover(function(){
   start();
});
$("#center").mouseout(function(){
   stop();
});

var requestId;

function loop(time) {
    requestId = undefined;

   for(var i = 0; i < angles.length; i++) {

        angle = angles[i];

        x = cx + radius * Math.cos(angle * deg2rad);
        y = cy + radius * Math.sin(angle * deg2rad);

        $('#sat' + i).css({left:x - radiusSat, top:y - radiusSat});

        angles[i] = angles[i] + 1;
        if (angles[i] > 360) angles[i] = 0;
    }

    //requestAnimationFrame(loop);

    stop();
}

function stop() {
    if (!requestId) {
       requestId = window.requestAnimationFrame(loop);
    }
}

function start() {
    if (requestId) {
       window.cancelAnimationFrame(requestId);
       requestId = undefined;
    }
}

div {
    border-radius:50%;
    border:2px solid #000;
    position:fixed;
}
#center {
    width:200px;
    height:200px;
    left:100px;
    top:100px;

}
#sat0, #sat1, #sat2, #sat3, #sat4 {
    width:50px;
    height:50px;

}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<div id="center"></div>
<div id="sat0"></div>
<div id="sat1"></div>
<div id="sat2"></div>
<div id="sat3"></div>
<div id="sat4"></div>


问:
Reflection: Why does parent close when child is closed?
I started playing around with Java Reflection and I am boggled as to why is my parent app closes when I close the child app's gui? Anyone care to explain and what should I do with my code?

```<code>URL url = new File(System.getProperty("user.dir")+"\\plugins\\"+plugins).toURI().toURL();
URL[] urls = new URL[]{url};

ClassLoader cl = new URLClassLoader(urls);
Class cls = cl.loadClass(mainclass);
Object plugs = cls.newInstance();
System.out.println("EXECUTING PLUGIN...");
Method meths = plugs.getClass().getMethod("getClassControl", JPanel.class);
meths.invoke(plugs, jPanel1);
System.out.println(plugins+" PLUGIN LOADED...");
</code>```

This code is inside the parent app which is a jframe with a jpanel.
What the involked method does is it passes the jpanel object to the class and the class adds a jbutton that has an action to display the child jframe.

whenever I try to close the child jframe, the whole process is terminated. I also tried changing the close operation of the child jframe to dispose yet it yields the same result.

答:
Probably you need to change

```<code>frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
</code>```

to

```<code>frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE)
</code>```

Body:
I started playing around with Java Reflection and I am boggled as to why is my parent app closes when I close the child app's gui? Anyone care to explain and what should I do with my code?

URL url = new File(System.getProperty("user.dir")+"\\plugins\\"+plugins).toURI().toURL();
URL[] urls = new URL[]{url};

ClassLoader cl = new URLClassLoader(urls);
Class cls = cl.loadClass(mainclass);
Object plugs = cls.newInstance();
System.out.println("EXECUTING PLUGIN...");
Method meths = plugs.getClass().getMethod("getClassControl", JPanel.class);
meths.invoke(plugs, jPanel1);
System.out.println(plugins+" PLUGIN LOADED...");

This code is inside the parent app which is a jframe with a jpanel.
What the involked method does is it passes the jpanel object to the class and the class adds a jbutton that has an action to display the child jframe.

whenever I try to close the child jframe, the whole process is terminated. I also tried changing the close operation of the child jframe to dispose yet it yields the same result.

Body:
Probably you need to change

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)

to

frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE)


问:
Relation between HTTP Keep Alive duration and TCP timeout duration
I am trying to understand the relation between TCP/IP and HTTP timeout values. Are these two timeout values different or same? Most Web servers allow users to set the HTTP Keep Alive timeout value through some configuration. How is this value used by the Web servers? is this value just set on the underlying TCP/IP socket i.e is the HTTP Keep Alive timeout and TCP/IP Keep Alive Timeout same? or are they treated differently?

My understanding is (maybe incorrect):
The Web server uses the default timeout on the underlying TCP socket (i.e. indefinite) regardless of the configured HTTP Keep Alive timeout and creates a Worker thread that counts down the specified HTTP timeout interval. When the Worker thread hits zero, it closes the connection.

EDIT:
My question is about the relation or difference between the two timeout durations i.e. what will happen when HTTP keep-alive timeout duration and the timeout on the Socket (SO_TIMEOUT) which the Web server uses is different? should I even worry about these two being same or not?

答:
An open TCP socket does not require any communication whatsoever between the two parties (let's call them Alice and Bob) unless actual data is being sent.  If Alice has received acknowledgments for all the data she's sent to Bob, there's no way she can distinguish among the following cases:

Bob has been unplugged, or is otherwise inaccessible to Alice.

Bob has been rebooted, or otherwise forgotten about the open TCP socket he'd established with Alice.

Bob is connected to Alice, and knows he has an open connection, but doesn't have anything he wants to say.

If Alice hasn't heard from Bob in awhile and wants to distinguish among the above conditions, she can resend her last byte of data, wrapped in a suitable TCP frame to be recognizable as a retransmission, essentially pretending she hasn't heard the acknowledgment.  If Bob is unplugged, she'll hear nothing back, even if she repeatedly sends the packet over a period of many seconds.  If Bob has rebooted or forgotten the connection, he will immediately respond saying the connection is invalid.  If Bob is happy with the connection and simply has nothing to say, he'll respond with an acknowledgment of the retransmission.

The Timeout indicates how long Alice is willing to wait for a response when she sends a packet which demands a reply.  The Keepalive time indicates how much time she should allow to lapse before she retransmits her last bit of data and demands an acknowledgment.  If Bob goes missing, the sum of the Keepalive and Timeout values will indicate the worst-case time between Alice receiving her last bit of data and her deciding that Bob is dead.


问:
Hide Div until hover on icon
I have hit a brick wall on this one, I am working on a website where I need to hide a DIV of extra content until the user hovers over an icon but I cannot figure out how to do this. I have tried various different ways (>, + and ~) but I just cant get it to work.

HTML

.fa-canapes-icon:hover .canapes-popup{
    display:block;

}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="canapes">
<p>Canapes <i class="fa fa-info-circle fa-canapes-icon"></i></p>
<div class="canapes-popup">
<h1>Example Canape Menu</h1>
<p>This is a popular selection. We do of course have other options we are happy to discuss with you.<br>
Mini Yorkshires with Medium Roast Beef and Horseradish<br>
Satay Chicken Skewers with a Peanut Sauce<br>
Spicy Prawn with Mango<br>
Smoked Salmon & Mascarpone crostini with Dill & Lemon<br>
Mozzerella Pearls with Sun-blush tomatoes & Fresh Basil (V)<br>
Honey and Sesame Coated Cocktail Sausages</p>
</div>
</div></code>```

The page can be viewed here and it is the 'wedding package 3' with the canapes i icon that I am trying to add it onto.

Any help would be greatly appreciated.

答:
You need to display on hover of p because p and your div is nearby so use this css

.canapes-popup{
    display:none;

}
p:hover + .canapes-popup{
    display:block;

}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div class="canapes">
<p>Canapes <i class="fa fa-info-circle fa-canapes-icon"></i></p>
<div class="canapes-popup">
<h1>Example Canape Menu</h1>
<p>This is a popular selection. We do of course have other options we are happy to discuss with you.<br>
Mini Yorkshires with Medium Roast Beef and Horseradish<br>
Satay Chicken Skewers with a Peanut Sauce<br>
Spicy Prawn with Mango<br>
Smoked Salmon & Mascarpone crostini with Dill & Lemon<br>
Mozzerella Pearls with Sun-blush tomatoes & Fresh Basil (V)<br>
Honey and Sesame Coated Cocktail Sausages</p>
</div>
</div></code>```

Title: Hide Div until hover on icon

Body:
I have hit a brick wall on this one, I am working on a website where I need to hide a DIV of extra content until the user hovers over an icon but I cannot figure out how to do this. I have tried various different ways (>, + and ~) but I just cant get it to work.

HTML

.fa-canapes-icon:hover .canapes-popup{
    display:block;

}

Canapes

Example Canape Menu

This is a popular selection. We do of course have other options we are happy to discuss with you.

Mini Yorkshires with Medium Roast Beef and Horseradish

Satay Chicken Skewers with a Peanut Sauce

Spicy Prawn with Mango

Smoked Salmon & Mascarpone crostini with Dill & Lemon

Mozzerella Pearls with Sun-blush tomatoes & Fresh Basil (V)

Honey and Sesame Coated Cocktail Sausages

The page can be viewed here and it is the 'wedding package 3' with the canapes i icon that I am trying to add it onto.

Any help would be greatly appreciated.

Body:
You need to display on hover of p because p and your div is nearby so use this css

.canapes-popup{
    display:none;

}
p:hover + .canapes-popup{
    display:block;

}

<div class="canapes">
<p>Canapes <i class="fa fa-info-circle fa-canapes-icon"></i></p>
<div class="canapes-popup">
<h1>Example Canape Menu</h1>
<p>This is a popular selection. We do of course have other options we are happy to discuss with you.<br>
Mini Yorkshires with Medium Roast Beef and Horseradish<br>
Satay Chicken Skewers with a Peanut Sauce<br>
Spicy Prawn with Mango<br>
Smoked Salmon &amp; Mascarpone crostini with Dill &amp; Lemon<br>
Mozzerella Pearls with Sun-blush tomatoes &amp; Fresh Basil (V)<br>
Honey and Sesame Coated Cocktail Sausages</p>
</div>
</div>


问:
Could someone please check my Tkinter and python code with a textfile?
Hi I have written my code and it works. It involves the use of tkinter and python and it works. However, there is one thing that I am not able to fix.

The one thing that I am not able to fix is in the last part of the code that is labeled with a comment and called "#Please fix part" and what is happening is that I can either press the right or left key to start the timer. However, the "Thanks for playing" message shows up only after pressing the right arrow key.
Additionally, why is the textfile not working?

Thanks for helping me!

Here is a link to the python code. The name of the file is BB.py
https://github.com/a210082/I2P-Summative

答:
I hope this works:
Firstly, I Believe the problem is here:

```<code>bb.unbind("<Right>")
bb.unbind("Left")
</code>```

Where it should be:

```<code>bb.unbind("<Right>")
bb.unbind("<Left>")
</code>```

and I only presume that's the problem because I could not find your comment.

With the textfile, the code should end with a close function. like so:

```<code>Balancetxt = open("scoreBaBo.txt","a+")
Balancetxt.write(str(timestr))
Balancetxt.write("\n")
</code>```

+

```<code>Balancetxt.close()
</code>```

I hope this helps!

Body:
I hope this works:
Firstly, I Believe the problem is here:

bb.unbind("<Right>")
bb.unbind("Left")

Where it should be:

bb.unbind("<Right>")
bb.unbind("<Left>")

and I only presume that's the problem because I could not find your comment.

With the textfile, the code should end with a close function. like so:

Balancetxt = open("scoreBaBo.txt","a+")
Balancetxt.write(str(timestr))
Balancetxt.write("\n")

+

Balancetxt.close()

I hope this helps!


问:
Python JSON get request for multiple websites
I'm trying to make a json get request on multiple urls.
(I'm new to programming as you will see below.)

My goal is to run this python script with multiple links. The only thing needs to be changed is the "b" part of the link, so it can run multiple searches with different numbers (strings), preferably using a list of numbers and exporting all the results to a csv list.

My question is: How should I change the code so I can use a list of numbers for "b" and get all the requests? (like a loop)

Please find below my code and thank you for your time.

```<code>import requests
import json

a = 'https://www.g2a.com/lucene/search/filter?jsoncallback=jQuery111002521088376353553_1491736907010&skip=28837%2C28838%2C28847%2C28849%2C28852%2C28856%2C28857%2C28858%2C28859%2C28860%2C28861%2C28862%2C28863%2C28867%2C28868%2C28869%2C29472%2C29473%2C29474%2C29475%2C29476%2C29482%2C29486%2C33104&minPrice=0.00&maxPrice=640.00&cn=&kr=&stock=all&event=&platform=0&search=&genre=0&cat=0&sortOrder=popularity+desc&start=0&rows=12&steam_app_id='
b = '515220'
c = '&steam_category=&steam_prod_type=&includeOutOfStock=false&includeFreeGames=false&_=1491736907012'
d = a + b + c

r = requests.get(d)
json_object = json.loads('{"data":%s}}' % (response.content.decode("utf-8").replace("jQuery111002521088376353553_1491736907010(", "")[:-2].replace("\'", "")))
for game in json_object["data"]["docs"]:
print ("Name: %s (Price: %s)" % (game["name"], game["minPrice"]))
</code>```

答:
You can loop over the list of b values like below,

l = [1,2,3,4]

```<code>for b in l:
    d = a + b + c
    r = requests.get(d)
    json_object = json.loads('{"data":%s}}' % (response.content.decode("utf-8").replace("jQuery111002521088376353553_1491736907010(", "")[:-2].replace("\'", "")))
    for game in json_object["data"]["docs"]:
    print ("Name: %s (Price: %s)" % (game["name"], game["minPrice"]))
</code>```

Body:
I'm trying to make a json get request on multiple urls.
(I'm new to programming as you will see below.)

My goal is to run this python script with multiple links. The only thing needs to be changed is the "b" part of the link, so it can run multiple searches with different numbers (strings), preferably using a list of numbers and exporting all the results to a csv list.

My question is: How should I change the code so I can use a list of numbers for "b" and get all the requests? (like a loop)

Please find below my code and thank you for your time.

import requests
import json

a = 'https://www.g2a.com/lucene/search/filter?jsoncallback=jQuery111002521088376353553_1491736907010&skip=28837%2C28838%2C28847%2C28849%2C28852%2C28856%2C28857%2C28858%2C28859%2C28860%2C28861%2C28862%2C28863%2C28867%2C28868%2C28869%2C29472%2C29473%2C29474%2C29475%2C29476%2C29482%2C29486%2C33104&minPrice=0.00&maxPrice=640.00&cn=&kr=&stock=all&event=&platform=0&search=&genre=0&cat=0&sortOrder=popularity+desc&start=0&rows=12&steam_app_id='
b = '515220'
c = '&steam_category=&steam_prod_type=&includeOutOfStock=false&includeFreeGames=false&_=1491736907012'
d = a + b + c

r = requests.get(d)
json_object = json.loads('{"data":%s}}' % (response.content.decode("utf-8").replace("jQuery111002521088376353553_1491736907010(", "")[:-2].replace("\'", "")))
for game in json_object["data"]["docs"]:
print ("Name: %s (Price: %s)" % (game["name"], game["minPrice"]))

Body:
You can loop over the list of b values like below,

l = [1,2,3,4]

for b in l:
    d = a + b + c
    r = requests.get(d)
    json_object = json.loads('{"data":%s}}' % (response.content.decode("utf-8").replace("jQuery111002521088376353553_1491736907010(", "")[:-2].replace("\'", "")))
    for game in json_object["data"]["docs"]:
    print ("Name: %s (Price: %s)" % (game["name"], game["minPrice"]))


问:
Algorithm for fairly assigning tasks to workers based on skills
(Before anyone asks, this is not homework.)

I have a set of workers with interests, i.e.:

Bob: Java, XML, Ruby

Susan: Java, HTML, Python

Fred: Python, Ruby

Sam: Java, Ruby

etc.

(There are actually somewhere in the range of 10-25 "interests" for each worker, and I have around 40-50 workers)

At the same time, I have a very large set of tasks that need to be distributed among the workers. Each task has to be assigned to at least 3 workers, and the workers must match at least one of the tasks' interests:

Task 1: Ruby, XML
Task 2: XHTML, Python

and so on. So Bob, Fred, or Sam could get Task 1; Susan or Fred could get Task 2.

This is all stored in a database thusly:

```<code>Task
    id integer primary key
    name varchar

TaskInterests
    task_id integer
    interest_id integer

Workers
    id integer primary key
    name varchar
    max_assignments integer

WorkerInterests
    worker_id
    interest_id

Assignments
    task_id
    worker_id
    date_assigned
</code>```

Each worker has a maximum number of assignments they will do, around 10. Some interests are more rare than others (i.e. only 1 or 2 workers have listed them as a interest), some interests are more common (i.e. half of the workers list them).

The algorithm must:

Assign every task to 3 workers (it is
assumed that at least 3 of the
workers are interested in one of the
interests of the task).

Assign every worker 1 or more tasks

Ideally, the algorithm will:

Assign each worker a number of tasks proportional to their maximum assignments and the total number of tasks. For example, if Susan says she will do 20 tasks and most people will only do 10 tasks and there are 50 workers and 300 tasks, she should be assigned 12 tasks (20/10*(300/50)).

Assign a variety of tasks to each worker, so if Susan lists 4 interests she gets tasks that include 4 interests (rather than getting 10 tasks all with the same interest)

The most difficult aspect so far has been dealing with theses issues:

tasks having interests with few corresponding workers

workers who have few interests, especially

workers who have a few interests, for which there are relatively few tasks

答:
For problems where finding a direct solution is difficult it can be a good idea to use an approximation algorithm, an evaulation function and a method to improve the solution. There are a variety of approaches, such as genetic algorithms and simulated annealing.

The basic idea is to use some sort of simple algorithm (such as a greedy algorithm) to get something that is vaguely usable and make random modifications, keeping those modifications that improve the evaluation score and discarding those that make it worse.

With genetic algorithms a group of for example 100 random solutions is generated and scored and the best are kept and "bred" to produce a new generation of solutions with characteristics similar to the previous generations, but with some random mutations.

For simulated annealing the probablility of a slightly worse solutions being accepted is high initially, but decreases over time. This reduces the risk of getting stuck at a local optimium early on.

Body:
(Before anyone asks, this is not homework.)

I have a set of workers with interests, i.e.:

Bob: Java, XML, Ruby

Susan: Java, HTML, Python

Fred: Python, Ruby

Sam: Java, Ruby

etc.

(There are actually somewhere in the range of 10-25 "interests" for each worker, and I have around 40-50 workers)

At the same time, I have a very large set of tasks that need to be distributed among the workers. Each task has to be assigned to at least 3 workers, and the workers must match at least one of the tasks' interests:

Task 1: Ruby, XML
Task 2: XHTML, Python

and so on. So Bob, Fred, or Sam could get Task 1; Susan or Fred could get Task 2.

This is all stored in a database thusly:

Task
    id integer primary key
    name varchar

TaskInterests
    task_id integer
    interest_id integer

Workers
    id integer primary key
    name varchar
    max_assignments integer

WorkerInterests
    worker_id
    interest_id

Assignments
    task_id
    worker_id
    date_assigned

Each worker has a maximum number of assignments they will do, around 10. Some interests are more rare than others (i.e. only 1 or 2 workers have listed them as a interest), some interests are more common (i.e. half of the workers list them).

The algorithm must:

Assign every task to 3 workers (it is
assumed that at least 3 of the
workers are interested in one of the
interests of the task).

Assign every worker 1 or more tasks

Ideally, the algorithm will:

Assign each worker a number of tasks proportional to their maximum assignments and the total number of tasks. For example, if Susan says she will do 20 tasks and most people will only do 10 tasks and there are 50 workers and 300 tasks, she should be assigned 12 tasks (20/10*(300/50)).

Assign a variety of tasks to each worker, so if Susan lists 4 interests she gets tasks that include 4 interests (rather than getting 10 tasks all with the same interest)

The most difficult aspect so far has been dealing with theses issues:

tasks having interests with few corresponding workers

workers who have few interests, especially

workers who have a few interests, for which there are relatively few tasks


问:
Implement FileMangerBundle (artgris) using TinyMCE with Symfony3
for my project I use FileManagerBundle of artgris. And i want to implement the windows in my view.twig, but i don't know where I need to create myFileBrowser().

This is my twig.html :

```<code>{% extends 'CoreBundle:Base:base.html.twig' %}

{% block title %}TEST DOWNLOAD{% endblock %}

{% block body %}
    <div class="row">
        <div class="col-md-12 box-blanche-ombre">
            <div class="row boutontitre">
                <div class="col-md-6">
                    <h1>TEST DOWNLOAD</h1>
                </div>
            </div>
            {% for type in ['primary','success', 'info', 'warning','danger'] %}
                {% for message in app.session.flashbag.get(type) %}
                    <p class="message bg-{{ type }}">{{ message|raw }}</p>
                {% endfor %}
            {% endfor %}
            <form method="post" action="dump.php">
                <textarea name="content"></textarea>
            </form>
        </div>
    </div>
{% endblock %}
{% block javascripts %}
    {{ parent() }}
    <script type="text/javascript">
        var BaseURL = "{{ app.request.getBaseURL() }}";
    </script>
    <script src="{{ asset('Bootstrap-Confirmation-master/bootstrap-confirmation.js') }}"></script>
    <script src="{{ asset('bootstrap-datepicker/js/bootstrap-datepicker.min.js') }}"></script>
    <script src="{{ asset('bootstrap-datepicker/locales/bootstrap-datepicker.fr.min.js') }}"></script>
     <script type="text/javascript">
        tinymce.init({
            selector: '#mytextarea',
            file_browser_callback: myFileBrowser,
            theme: 'modern',
            height: 300,
            plugins: [
                'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
                'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
                'save table contextmenu directionality emoticons template paste textcolor'
            ],
            toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | print preview media fullpage | forecolor backcolor emoticons'
        });

        function myFileBrowser(field_name, url, type, win) {

        var cmsURL = "{{ path('file_manager', {module:'tiny', conf:'tiny'}) }}";
        if (cmsURL.indexOf("?") < 0) {
            cmsURL = cmsURL + "?type=" + type;
        }
        else {
            cmsURL = cmsURL + "&type=" + type;
        }

        tinyMCE.activeEditor.windowManager.open({
            file: cmsURL,
            title: 'File Manager',
            width: 1024,
            height: 500
        }, {
            window: win,
            input: field_name
        });
        return false;
    }
    </script>
{% endblock %}
</code>```

This is the link to the doc, if you have a idea, thank you !

https://github.com/artgris/FileManagerBundle/blob/master/Resources/doc/tutorials/integrate-tinymce.md

Ho yeah, I can access to mywebsite.com/manager/?conf=default

答:
You init your tinymce with selector: '#mytextarea' but your html not include this id, you should first add id on textarea:

```<code><textarea name="content" id="mytextarea"></textarea>
</code>```

about myFileBrowser function, it's in right place.

Body:
for my project I use FileManagerBundle of artgris. And i want to implement the windows in my view.twig, but i don't know where I need to create myFileBrowser().

This is my twig.html :

{% extends 'CoreBundle:Base:base.html.twig' %}

{% block title %}TEST DOWNLOAD{% endblock %}

{% block body %}

TEST DOWNLOAD

            {% for type in ['primary','success', 'info', 'warning','danger'] %}
                {% for message in app.session.flashbag.get(type) %}

{{ message|raw }}

                {% endfor %}
            {% endfor %}
            <form method="post" action="dump.php">
                <textarea name="content"></textarea>
            </form>

{% endblock %}
{% block javascripts %}
    {{ parent() }}

{% endblock %}

This is the link to the doc, if you have a idea, thank you !

https://github.com/artgris/FileManagerBundle/blob/master/Resources/doc/tutorials/integrate-tinymce.md

Ho yeah, I can access to mywebsite.com/manager/?conf=default

Body:
You init your tinymce with selector: '#mytextarea' but your html not include this id, you should first add id on textarea:

<textarea name="content" id="mytextarea"></textarea>

about myFileBrowser function, it's in right place.