Updates from BitShares FC #22

Closed
nathanielhourt wants to merge 693 commits from dapp-support into latest-fc
4 changed files with 10 additions and 3 deletions
Showing only changes of commit 869ad45242 - Show all commits

View file

@ -46,7 +46,7 @@ namespace fc {
shared_ptr( shared_ptr&& p ) shared_ptr( shared_ptr&& p )
:_ptr(p._ptr){ p._ptr = nullptr; } :_ptr(p._ptr){ p._ptr = nullptr; }
~shared_ptr() { if( nullptr != _ptr ) { _ptr->release(); } } ~shared_ptr() { if( nullptr != _ptr ) { _ptr->release(); _ptr = nullptr; } }
shared_ptr& reset( T* v = nullptr, bool inc = false ) { shared_ptr& reset( T* v = nullptr, bool inc = false ) {
if( v == _ptr ) return *this; if( v == _ptr ) return *this;

View file

@ -39,7 +39,10 @@ namespace fc
~openssl_scope() ~openssl_scope()
{ {
FIPS_mode_set(0);
CONF_modules_unload(1);
EVP_cleanup(); EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_free_strings(); ERR_free_strings();
} }
}; };

View file

@ -77,6 +77,7 @@ namespace fc {
try { try {
set_thread_name(name.c_str()); // set thread's name for the debugger to display set_thread_name(name.c_str()); // set thread's name for the debugger to display
this->my = new thread_d( *this, notifier ); this->my = new thread_d( *this, notifier );
cleanup();
current_thread() = this; current_thread() = this;
p->set_value(); p->set_value();
exec(); exec();
@ -126,8 +127,10 @@ namespace fc {
} }
void thread::cleanup() { void thread::cleanup() {
delete current_thread(); if ( current_thread() ) {
current_thread() = nullptr; delete current_thread();
current_thread() = nullptr;
}
} }
const string& thread::name()const const string& thread::name()const

View file

@ -52,6 +52,7 @@ namespace fc {
~thread_d() ~thread_d()
{ {
delete current; delete current;
current = nullptr;
fc::context* temp; fc::context* temp;
for (fc::context* ready_context : ready_heap) for (fc::context* ready_context : ready_heap)
delete ready_context; delete ready_context;