igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Destroying uninitialized graphs


From: Tamas Nepusz
Subject: Re: [igraph] Destroying uninitialized graphs
Date: Mon, 07 Mar 2011 16:32:17 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8

> I currently have a problem in that my program seg faults because I am 
> calling igraph_destroy() on an uninitialized graph.
>
> Is there a function to tell whether the graph is initialized?
No, not at the moment, you have to keep track of it yourself. If you can
do with a crude and hackish solution, do the following: 1) fill the
memory area corresponding to your graph with zeroes using memset after
you allocate it and 2) whenever you are about to destroy a graph, check
whether the entire memory area contains zeroes only. If so, don't
destroy the graph.

-- 
Tamas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]