mirror of
				https://github.com/asticode/go-astiav.git
				synced 2025-10-31 19:43:10 +08:00 
			
		
		
		
	Now removing from classers after the free method
This commit is contained in:
		| @@ -38,8 +38,15 @@ func (cc *CodecContext) Free() { | ||||
| 		C.av_buffer_unref(&cc.hdc.c) | ||||
| 		cc.hdc = nil | ||||
| 	} | ||||
| 	classers.del(cc) | ||||
| 	C.avcodec_free_context(&cc.c) | ||||
| 	if cc.c != nil { | ||||
| 		// Make sure to clone the classer before freeing the object since | ||||
| 		// the C free method resets the pointer | ||||
| 		c := newClonedClasser(cc) | ||||
| 		C.avcodec_free_context(&cc.c) | ||||
| 		// Make sure to remove from classers after freeing the object since | ||||
| 		// the C free method may use methods needing the classer | ||||
| 		classers.del(c) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (cc *CodecContext) String() string { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Quentin Renard
					Quentin Renard