Skip to content

Commit

Permalink
Oscplot: Associate a iio context to the oscplot object
Browse files Browse the repository at this point in the history
Instead of using the iio context as an external global variable, store the context as a private member of the oscplot object.
Otherwise whoever created a new oscplot object was forced to use the iio context created in the osc.c.

Signed-off-by: Dan <[email protected]>
  • Loading branch information
dNechita committed Jun 16, 2015
1 parent b5bd82e commit a968ff3
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 58 deletions.
4 changes: 2 additions & 2 deletions osc.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GtkWidget *versioncheck_en;
GtkWidget *main_window;

struct iio_context *ctx;
unsigned int num_devices = 0;
static unsigned int num_devices = 0;
bool ctx_destroyed_by_do_quit;

static void gfunc_save_plot_data_to_ini(gpointer data, gpointer user_data);
Expand Down Expand Up @@ -1328,7 +1328,7 @@ GtkWidget * new_plot_cb(GtkMenuItem *item, gpointer user_data)
{
GtkWidget *new_plot;

new_plot = osc_plot_new();
new_plot = osc_plot_new(ctx);
osc_plot_set_visible(OSC_PLOT(new_plot), true);
plot_init(new_plot);

Expand Down
Loading

0 comments on commit a968ff3

Please sign in to comment.