projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge: repair break in audio capture
[goodguy/history.git]
/
cinelerra-5.1
/
cinelerra
/
pluginclient.C
diff --git
a/cinelerra-5.1/cinelerra/pluginclient.C
b/cinelerra-5.1/cinelerra/pluginclient.C
index 64c7d53f6649d64ef1e0131d59e688d764c15fc5..cccdcde077d8bc6bfefe9c021b2b1b9f99a4dc02 100644
(file)
--- a/
cinelerra-5.1/cinelerra/pluginclient.C
+++ b/
cinelerra-5.1/cinelerra/pluginclient.C
@@
-56,9
+56,8
@@
PluginClientThread::PluginClientThread(PluginClient *client)
PluginClientThread::~PluginClientThread()
{
//printf("PluginClientThread::~PluginClientThread %p %d\n", this, __LINE__);
PluginClientThread::~PluginClientThread()
{
//printf("PluginClientThread::~PluginClientThread %p %d\n", this, __LINE__);
-
delete window
;
+
join()
;
//printf("PluginClientThread::~PluginClientThread %p %d\n", this, __LINE__);
//printf("PluginClientThread::~PluginClientThread %p %d\n", this, __LINE__);
- window = 0;
delete init_complete;
}
delete init_complete;
}
@@
-85,8
+84,7
@@
void PluginClientThread::run()
//printf("PluginClientThread::run %p %d\n", this, __LINE__);
window->hide_window(1);
window->unlock_window();
//printf("PluginClientThread::run %p %d\n", this, __LINE__);
window->hide_window(1);
window->unlock_window();
-
-
+ delete window; window = 0;
// Can't save defaults in the destructor because it's not called immediately
// after closing.
/* if(client->defaults) */ client->save_defaults_xml();
// Can't save defaults in the destructor because it's not called immediately
// after closing.
/* if(client->defaults) */ client->save_defaults_xml();
@@
-144,35
+142,14
@@
PluginClientWindow::PluginClientWindow(PluginClient *client,
: BC_Window(client->gui_string,
client->window_x /* - w / 2 */,
client->window_y /* - h / 2 */,
: BC_Window(client->gui_string,
client->window_x /* - w / 2 */,
client->window_y /* - h / 2 */,
- w,
- h,
- min_w,
- min_h,
- allow_resize,
- 0,
- 1)
+ w, h, min_w, min_h, allow_resize, 0, 1)
{
this->client = client;
}
PluginClientWindow::PluginClientWindow(const char *title,
{
this->client = client;
}
PluginClientWindow::PluginClientWindow(const char *title,
- int x,
- int y,
- int w,
- int h,
- int min_w,
- int min_h,
- int allow_resize)
- : BC_Window(title,
- x,
- y,
- w,
- h,
- min_w,
- min_h,
- allow_resize,
- 0,
- 1)
+ int x, int y, int w, int h, int min_w, int min_h, int allow_resize)
+ : BC_Window(title, x, y, w, h, min_w, min_h, allow_resize, 0, 1)
{
this->client = 0;
}
{
this->client = 0;
}
@@
-217,11
+194,7
@@
PluginClient::PluginClient(PluginServer *server)
PluginClient::~PluginClient()
{
// Delete the GUI thread. The GUI must be hidden with hide_gui first.
PluginClient::~PluginClient()
{
// Delete the GUI thread. The GUI must be hidden with hide_gui first.
- if(thread)
- {
- thread->join();
- delete thread;
- }
+ delete thread;
// Virtual functions don't work here.
if(defaults) delete defaults;
// Virtual functions don't work here.
if(defaults) delete defaults;
@@
-384,7
+357,7
@@
int PluginClient::set_string()
if(thread)
{
thread->window->lock_window("PluginClient::set_string");
if(thread)
{
thread->window->lock_window("PluginClient::set_string");
- thread->window->
se
t_title(gui_string);
+ thread->window->
pu
t_title(gui_string);
thread->window->unlock_window();
}
return 0;
thread->window->unlock_window();
}
return 0;
@@
-619,23
+592,21
@@
void PluginClient::save_defaults_xml()
using_defaults = 1;
KeyFrame temp_keyframe;
using_defaults = 1;
KeyFrame temp_keyframe;
-
save_data(&temp_keyframe);
save_data(&temp_keyframe);
- FILE *fd = fopen(path, "w");
- if(fd)
- {
- fprintf(fd, "%d\n%d\n", window_x, window_y);
- if(!fwrite(temp_keyframe.get_data(), strlen(temp_keyframe.get_data()), 1, fd))
- {
+
+ const char *data = temp_keyframe.get_data();
+ int len = strlen(data);
+ FILE *fp = fopen(path, "w");
+
+ if( fp ) {
+ fprintf(fp, "%d\n%d\n", window_x, window_y);
+ if( len > 0 && !fwrite(data, len, 1, fp) ) {
fprintf(stderr, "PluginClient::save_defaults_xml %d \"%s\" %d bytes: %s\n",
fprintf(stderr, "PluginClient::save_defaults_xml %d \"%s\" %d bytes: %s\n",
- __LINE__,
- path,
- (int)strlen(temp_keyframe.get_data()),
- strerror(errno));
+ __LINE__, path, len, strerror(errno));
}
}
-
- fclose(fd);
+ fclose(fp);
}
}
+
using_defaults = 0;
}
using_defaults = 0;
}