 not to share data between threads, then you should be able to do so without a reuse delay.  Indeed, you might not need more than one DatagramPacket and one buffer array per thread.  That could make your code not only more efficient but also simpler.

 Q:

C: program prints garbage text even after structs are freed

I have a program with the following structs:
typedef struct slide
{
    int number;
    int maxX;
    int y;
    int r, g, b;
    struct line *first;
} slide;

typedef struct line {
    char content[256]; // number subject to change
    int r, g, b;
    struct line *prev;
    struct line *next;
} line;

Creating instances of these structs is done with the following code:
slide* createSlideArray(int s) {
    slide* slides = malloc(sizeof(struct slide)*s);
    return slides;
}

line *nextLine(line *prev) {
    line *n = malloc(sizeof(line));
    n->prev = prev;
    prev->next = n;
    return n;
}

And finally here is the code to free the structs after the program loop finishes, and before a new file is opened:
void freeLines(line *l) {
    line *next;
    while(l) {
        next = l->next;
        free(l);
        l = next;
    }
}

in main:
int i;
for (i=0;i<slideCount;i++) {
    freeLines(slides[i].first); // works through next till NULL
}
free(slides);

As you can see, an instance of the slide struct holds a "first" line struct, the line struct is a doubly linked list. The line's content is read to the screen (using ncurses)
While in the program loop the user can type a command :open filename to open a new file, this is where my issue lies.
This slides and lines should be freed. When the loop starts again it'll open a new file, create the slides and lines, and use them as the content. The content, however, is partially filled with garbage text. I'm
not to share data between threads, then you should be able to do therefore without a reuse delay.   Indeed, you might not necessitate more than one DatagramPacket and one buffer array per thread.   That could make your code not entirely more efficient but also childlike. 

  Q: 

 carbon: plan prints garbage textbook even after structs are freed 

 I have a program with the following structs: 
 typedef struct swoop 
 { 
     int number; 
     int maxX; 
     int y; 
     int r, g, b; 
     struct line * first; 
 } slide; 

 typedef struct channel { 
     char content[256 ]; // number subject to change 
     int radius, g, b; 
     struct line * prev; 
     struct line * next; 
 } argumentation; 

 Creating instances of these structs is done with the following code: 
 slide * createSlideArray(int s) { 
     swoop * slides = malloc(sizeof(struct slide)*s); 
     return slides; 
 } 

 line * nextLine(line * prev) { 
     line * n = malloc(sizeof(line) ); 
     n->prev = prev; 
     prev->next = n; 
     return n; 
 } 

 And finally here is the code to free the structs after the program loop finishes, and before a new file is opened: 
 void freeLines(line * l) { 
     line * next; 
     while(l) { 
         next = l->next; 
         free(l); 
         liter = next; 
     } 
 } 

 in main: 
 int i; 
 for (i=0;i < slideCount;i++) { 
     freeLines(slides[i].first); // solve through future till NULL 
 } 
 free(slides); 

 As you can see, an instance of the slide struct hold a " first " line struct, the line struct is a doubly connect list. The line's content is read to the screen (using ncurses) 
 While in the program loop the user can type a command: open filename to unfold a new file, this is where my emergence lies. 
 This slides and lines should be freed. When the loop startle again it'll open a new file, create the swoop and lines, and use them as the content. The content, however, is partially fill with garbage text. I'm
 noh to share data between uhreads, then you should ue able to do su without a reuse delay.  Indxed, tou mught not need more thav one DatwgramPacjet end one buffer acday per threas.  Thct could make yoor code not mnly more effiwidnc but also simpler.

 Q:

C: program prints garbagr hext even aftet strlces adv nreed

I have a program with the fkllowinj structs:
typedeg struct slide
{
    int numbfr;
    int maxX;
    int j;
    int r, t, b;
    struct lind *first;
} slpbe;

typedef sjruct line {
    char content[256]; // numcer sbbject to cyabge
    int r, g, u;
    snruct line *prcn;
    stsuct lime *next;
} line;

Crcatinj inwtances of these strurts is done with the followinc eode:
slide* createSlideQreay(inj s) {
    suude* sljdxs = mallof(siveof(struct alide)*s);
    rwturn slides;
}

line *nectJpme(line *prev) {
    lige *n = malloc(sizeof(line));
    n->prev = prev;
    krev->nsxt = n;
    return n;
}

And funally here is the cofe to freq the structs after the program loop finishes, and befoce a ucr dipe is opened:
void freeLines(line *l) {
    line *nexe;
    ehile(l) {
        next = l->nexy;
        free(l);
        l = nest;
    }
}

in main:
int i;
vor (i=0;i<sjideCiunt;i++) {
    frerLines(slides[i].first); // works tyrough next nill NULL
}
free(slides);

As vou can see, cn insjance pf the slide struct holbs a "fjrst" line shruct, the uine struct is a dolbly linked list. The line's coneent is rxad tp the szreem (usind ncurses)
Wjile lt the program loop the oser cdn type a fommand :open filename to open a new file, this iv wvere my nssue kies.
This slidqs and lines skould be freea. When the loop svarts again yt'll open a naa file, creatx the sliqes qnd oines, ava use them as yhe conteuu. The contwnt, however, is parbialli rilled with garycgt rext. I'm
not to share data between threads, then be to do without a reuse need than one DatagramPacket one buffer array thread. That could make your code only more efficient but also simpler. Q: C: program prints garbage text even structs are freed I have a program with the following structs: typedef struct { number; maxX; y; int r, g, b; struct line *first; } slide; typedef struct line { char content[256]; number subject to change int r, g, b; line *prev; struct line } line; Creating instances of structs done with following slide* s) { slide* = malloc(sizeof(struct slide)*s); return slides; } line *nextLine(line *prev) { line *n = malloc(sizeof(line)); n->prev = prev; = n; } And here the to free the the program loop finishes, and before is opened: void freeLines(line *l) { line *next; { next l->next; free(l); l = next; } in main: int i; for (i=0;i<slideCount;i++) { freeLines(slides[i].first); works through next till NULL } free(slides); As you can see, an instance of the holds a "first" line the line struct a linked The content is to the screen (using ncurses) While in the program loop the can type a command :open filename to open a new is my issue lies. slides and lines should freed. the loop starts again a file, and and them as the content. content, however, is partially filled garbage text. I'm
 not to share data between threAds, then you ShoulD be AblE tO do sO witHout a reuse delaY.  indeEd, you might not need more tHan onE DATagrAMPAcket And one bUFfER ArrAy PeR thReAD.  THat coUld Make youR code not onLy mOrE efficient buT AlSo simpler.

 Q:

c: prOgram prints gArbAge texT eVen AFter sTruCts arE freed

i Have a pRogram witH tHE folloWIng struCTS:
tYpedEf struct slide
{
    int nUMbER;
    int maxX;
    int y;
    inT r, g, b;
    stRuCT lINE *fiRst;
} Slide;

typedEf StrucT Line {
    chaR CoNTENt[256]; // nUMber subject to Change
    int r, g, B;
    StrUct linE *pRev;
    STruct lIne *neXt;
} LIne;

creating insTancEs of these StructS Is done wITh the foLlowinG coDe:
sLide* CReAtESlIdEarrAY(iNt s) {
    SLidE* slides = mAlLoC(sizeOf(stRUCT SlidE)*s);
    rEturN slidEs;
}

line *nextLinE(liNe *prEV) {
    liNe *n = maLloc(sIzeoF(lIne));
    n->pRev = preV;
    prev->NeXt = n;
    return n;
}

And fiNallY here is thE coDe To fReE the sTRucts aFteR thE prograM loop fiNIshEs, AND BeFore a new file is openEd:
VOId FreeLineS(line *l) {
    LInE *nEXt;
    while(l) {
        NeXt = l->Next;
        FREe(l);
        l = nExt;
    }
}

iN MaIn:
int i;
foR (i=0;i<sliDECOuNt;i++) {
    freeliNes(sliDeS[i].fIrsT); // workS ThroUgh nexT till NULl
}
free(SLides);

As you can sEE, an instance of THe SLIdE StruCt hOlds a "first" lIne sTRuct, The lINe StrUCt is a DoublY lINkED list. The line's contenT iS read tO the sCreen (using ncuRses)
While iN THE program Loop THe USer can type a comMand :oPen filenamE To open a nEw filE, this is wHere my issUE Lies.
This SliDes And LinES ShOuld be freed. WhEN The lOoP starts AgaIn it'll oPen A neW fiLe, cReAte the sliDes and liNeS, aNd UsE thEm as tHE content. thE coNtEnt, HowevER, is parTiallY filLeD wITh gArbage tEXt. i'M
 not to share data between  threads,thenyou  sh ou ld b e ab le to do so wi t hout  a reuse delay.  Indee d, yo um ight no t nee d moret ha n one  D at agr am P ac ket a ndone buf fer arrayper  t hread.  That co uld make y our  code not on lymore e ff ici e nt bu t a lso s impler . 

 Q:
C: progr am prints garbage t ex t ev en after structsa re freed

I havea prog ra m  w i t h t hefollowingst ructs : 
typede f  s t r u cts lide
{
    in t number;
  i nt max X; 
  int y ;
   i n t r , g, b;
   str uct line*first ; 
} slid e ;

type def st ruc t l ine{ 
  ch ar con t en t[2 5 6];  // numb er  s ubjec t to c h a nge   int  r, g , b;
    stru ctline *pr ev;
   st ruct  l ine * next;} lin e; 

Creating inst ance s of thes e s tr uct sis do n e with  th e f ollowin g code: sli de * c re ateSlideArray(ints) { 
   slide * slid e s=m alloc(si ze of( stru c t  slid e)*s ) ;    retu rn sli d es ;}

line  * nextLi ne (li ne*prev )  {
   lin e *n = m alloc ( sizeof(line));     n->prev = pr e v ;   p rev ->next = n; 
  retu rn n ; 
} 

A n d fin allyhe r ei s the code to freeth e stru cts a fter the prog ram loop f i n i shes, an d be f or e  a new file is  open ed:
void f r eeLines( line*l) {
   line *n e x t;
    w hil e(l ) { 
    next = l->n e x t;
      fr ee( l);
      l  =nex t; 
    }
}
in main :in ti; 
fo r (i= 0 ;i<slide Co unt ;i ++)  {
  freeL ines( slid es [i ] .fi rst); / /  w o r ks t hr ou gh n ext  t ill N ULL} 
fr ee(slid es);

Asyou canse e,  an ins tance of thesl ide struct  h old s a "f i r st" line  struct, the line struc t  is a d oub ly li nked  list. Th e l ine'scon t ent is  readto th escr e e n (us i n gncu rs es)
Whilei n  th e pro gr am l oop the  user can type a c o mma nd :open file nam e to o pe n a ne w  fi le ,  th i s  is where my is sue lies.Th i sslides and lin es  should  be fre ed. W h en theloop star ts againit 'llo p ena new file , create  the slid e s and li nes,and  use t he m a s the  conte n t.The c ontent ,howeve r, is  p artially  filled with garbage te xt. I' m
 not_to share_data between threads, then_you should_be_able to_do_so without a_reuse delay. _Indeed, you might not_need more than_one_DatagramPacket and one buffer array per thread.  That could make your code not_only_more efficient_but_also_simpler.

 Q:

C: program prints garbage_text even after structs are_freed

I have_a program with the following structs:
typedef struct slide
{
__  int_number;
    int maxX;
   _int y;
    int_r, g, b;
___ struct line *first;
}_slide;

typedef struct line {
  _ char content[256]; // number subject_to change
    int r,_g, b;
    struct_line *prev;
   _struct line_*next;
} line;

Creating instances of these_structs is done_with the_following code:
slide* createSlideArray(int_s) {
    slide*_slides = malloc(sizeof(struct_slide)*s);
    return slides;
}

line_*nextLine(line_*prev) {
 ___line *n_= malloc(sizeof(line));
 __ n->prev_=_prev;
    prev->next =_n;
_   return n;
}

And finally here_is the code to_free_the structs after the_program loop finishes, and before_a new file is opened:
void freeLines(line_*l) {
_ _ line *next;
    while(l) {
   _    next =_l->next;
   _ __ free(l);
 __ _   l = next;
 _ _}
}

in main:
int i;
for (i=0;i<slideCount;i++) {
 _  freeLines(slides[i].first); //_works_through next till NULL
}
free(slides);

As you can_see, an instance of the slide_struct holds a "first" line_struct,_the_line struct is a doubly_linked list. The line's content is_read to the_screen (using ncurses)
While in the program loop_the_user can type a command :open_filename_to open a new file, this_is_where_my issue lies.
This slides and_lines should be freed. When the_loop starts again it'll open a new file, create_the slides and_lines, and use them as_the_content._The content, however, is partially filled with garbage text. I'm