Skip to content

Commit

Permalink
Fix gephi#1566 GePhi freezes after successfully importing dynamic gex…
Browse files Browse the repository at this point in the history
…f file
  • Loading branch information
eduramiba committed Aug 3, 2017
1 parent 426c55b commit 297792d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ public Partition getPartition(Column column) {

protected void refreshFunctions() {
graph.readLock();

try {
boolean graphHasChanged = graphObserver.isNew() || graphObserver.hasGraphChanged();
if (graphHasChanged) {
Expand All @@ -482,7 +481,7 @@ protected void refreshFunctions() {
}
refreshAttributeFunctions(graphHasChanged);
} finally {
graph.readUnlock();
graph.readUnlockAll();
}
}

Expand Down Expand Up @@ -648,6 +647,7 @@ private boolean isPartition(Graph graph, Column column) {
Object[] va = val.toValuesArray();
for (Object v : va) {
if (v != null) {
iterable.doBreak();
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ Development and Distribution License("CDDL") (collectively, the
import javax.swing.JToggleButton;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import org.gephi.appearance.api.AttributeFunction;
import org.gephi.appearance.api.Function;
import org.gephi.appearance.api.Interpolator;
import org.gephi.appearance.api.RankingFunction;
import org.gephi.appearance.spi.TransformerUI;
import org.gephi.graph.api.Column;
import org.gephi.ui.components.splineeditor.SplineEditor;
import org.gephi.ui.utils.UIUtils;
import org.netbeans.api.settings.ConvertAsProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ public void exportToColumn(String title, Query query) {
e.setAttribute(edgeCol, Boolean.TRUE);
}
} finally {
result.readUnlockAll();
result.writeUnlock();
result.readUnlockAll();
}
//StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(FilterControllerImpl.class, "FilterController.exportToColumn.status", title));
}
Expand Down Expand Up @@ -398,8 +398,8 @@ public void exportToLabelVisible(Query query) {
e.getTextProperties().setVisible(inView);
}
} finally {
fullGraph.readUnlockAll();
fullGraph.writeUnlock();
fullGraph.readUnlockAll();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public Graph process(AbstractQueryImpl query, GraphModel graphModel) {

return finalResult;
} finally {
graph.readUnlockAll();
graph.writeUnlock();
graph.readUnlockAll();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ private void executeDynamic(DynamicStatistics statistics, DynamicLongTask dynami
statistics.loop(g.getView(), new Interval(low, high));
} finally {
graph.writeUnlock();
graph.readUnlockAll();
}

//Cancelled?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public synchronized boolean updateWorld() {
force = true;
} finally {
graphModel.getGraph().writeUnlock();
graphModel.getGraph().readUnlockAll();
}
}

Expand Down Expand Up @@ -310,8 +311,8 @@ public synchronized void reset() {
}
} finally {
if (graphModel != null) {
graph.readUnlockAll();
graph.writeUnlock();
graph.readUnlockAll();
}
}

Expand Down

0 comments on commit 297792d

Please sign in to comment.