History

clean up after otf thread

Jack Atherton committed 9 years ago

Commit 83c52371 parent 61e2e111 file · +18 −3Browse files

Unified · Split

src/core/chuck.cpp+18−3
@@ -605,6 +605,23 @@ bool ChucK::shutdown() · 604 unmodified lines
605 }605 }
606 606
607 // free vm, compiler, friends607 // free vm, compiler, friends
608 // first, otf
609 // REFACTOR-2017 TODO: le_cb?
610
611 // cancel otf thread
612#if !defined(__PLATFORM_WIN32__) || defined(__WINDOWS_PTHREAD__)
613 if( m_carrier->otf_thread ) pthread_cancel( m_carrier->otf_thread );
614#else
615 if( m_carrier->otf_thread ) CloseHandle( m_carrier->otf_thread );
616#endif
617 // close otf socket
618 if( m_carrier->otf_socket ) ck_close( m_carrier->otf_socket );
619
620 // reset
621 m_carrier->otf_socket = NULL;
622 m_carrier->otf_port = 0;
623 m_carrier->otf_thread = 0;
624
608 // TODO: a different way to unlock?625 // TODO: a different way to unlock?
609 // unlock all objects to delete chout, cherr626 // unlock all objects to delete chout, cherr
610 Chuck_VM_Object::unlock_all();627 Chuck_VM_Object::unlock_all();
@@ -612,12 +629,10 @@ bool ChucK::shutdown() · 1 unmodified line
612 SAFE_RELEASE( m_carrier->cherr );629 SAFE_RELEASE( m_carrier->cherr );
613 // relock630 // relock
614 Chuck_VM_Object::lock_all();631 Chuck_VM_Object::lock_all();
632 // clean up vm, compiler
615 SAFE_DELETE( m_carrier->vm );633 SAFE_DELETE( m_carrier->vm );
616 SAFE_DELETE( m_carrier->compiler );634 SAFE_DELETE( m_carrier->compiler );
617 m_carrier->env = NULL;635 m_carrier->env = NULL;
618 m_carrier->otf_socket = NULL; // TODO: properly dealloc
619 m_carrier->otf_port = 0;
620 m_carrier->otf_thread = 0; // TODO: properly dealloc
621 636
622 // flag637 // flag
623 m_init = FALSE;638 m_init = FALSE;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t