}
DetailAssetThread::~DetailAssetThread()
+{
+ stop();
+}
+
+void DetailAssetThread::stop()
{
if( Thread::running() ) {
- dwindow->lock_window("DetailAssetThread::~DetailAssetThread");
+ dwindow->lock_window("DetailAssetThread::stop");
dwindow->set_done(1);
dwindow->unlock_window();
Thread::join();
void DetailAssetThread::start(Asset *asset)
{
- if( !Thread::running() ) {
- delete dwindow;
- dwindow = new DetailAssetWindow(mwindow, asset);
- Thread::start();
- }
+ stop();
+ delete dwindow;
+ dwindow = new DetailAssetWindow(mwindow, asset);
+ Thread::start();
}
void DetailAssetThread::run()
~DetailAssetThread();
void start(Asset *asset);
+ void stop();
void run();
};
break;
}
close_format_windows();
+ update_format();
}
void FormatTools::update_format()
const char *extension = File::get_tag(asset->format);
// split multiple extensions
ArrayList<const char*> extensions;
- int len = strlen(extension);
+ int len = !extension ? -1 : strlen(extension);
const char *extension_ptr = extension;
for(int i = 0; i <= len; i++)
{
class Thread
{
static void* entrypoint(void *parameters);
- bool exists() { return tid != ((pthread_t)-1); }
protected:
virtual void run() = 0;
int enable_cancel();
int disable_cancel();
int get_cancel_enabled();
+ bool exists() { return tid != ((pthread_t)-1); }
bool running() { return exists() && !finished; }
int get_synchronous();