/* PSPP - a program for statistical analysis.
- Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
+ Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011, 2013, 2016 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
if (session != ds->session)
{
+ dataset_ref (ds);
if (ds->session != NULL)
session_remove_dataset (ds->session, ds);
if (session != NULL)
session_add_dataset (session, ds);
+ dataset_unref (ds);
}
}
void
dataset_set_session__ (struct dataset *ds, struct session *session)
{
- ds->session = session;
+ if (ds->session != session)
+ {
+ if (ds->session)
+ dataset_unref (ds->session);
+ ds->session = session;
+ if (session)
+ dataset_ref (session);
+ }
}